title: cannot convert boost::lambda::... to long long unsigned int
body: <p>I have a simple program using boost 1.56 headers:</p>
  
  <pre><code>#include &lt;boost/lambda/lambda.hpp&gt;
  #include &lt;boost/lambda/bind.hpp&gt;
  #include &lt;algorithm&gt;
  #include &lt;iostream&gt;
  
  int main(int argc, char* args[])
  {
    size_t a[] = { 1, 2, 3, 4 };
    size_t b[] = { 5, 6, 7, 8 };
    std::transform(a, a+4, b, a, (boost::lambda::_1 + boost::lambda::_2));
    for (int i=0; i&lt;4; ++i)
      std::cout &lt;&lt; a[i] &lt;&lt; ", ";
    std::cout &lt;&lt; std::endl;
  
    return 0;
  }
  </code></pre>
  
  <p>which is compiled by g++-4.9.1 on Debian Linux and runs fine, both for 32bit and 64bit architectures.</p>
  
  <p>also i686-w64-mingw32-g++ (4.9.1) cross-compiles and runs fine.</p>
  
  <p>however x86_64-w64-mingw32-g++ (4.9.1) fails to cross-compile for 64bit architecture like this:</p>
  
  <pre><code>$ x86_64-w64-mingw32-g++ -I/opt/win64/include transform.cpp -static
  In file included from /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/algorithm:62:0,
               from /opt/win64/include/boost/core/swap.hpp:25,
               from /opt/win64/include/boost/utility/swap.hpp:15,
               from /opt/win64/include/boost/tuple/detail/tuple_basic.hpp:40,
               from /opt/win64/include/boost/tuple/tuple.hpp:28,
               from /opt/win64/include/boost/lambda/core.hpp:28,
               from /opt/win64/include/boost/lambda/lambda.hpp:14,
               from transform.cpp:1:
  /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/bits/stl_algo.h: In instantiation of ‘_OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation) [with _IIter1 = long long unsigned int*; _IIter2 = long long unsigned int*; _OIter = long long unsigned int*; _BinaryOperation =    boost::lambda::lambda_functor&lt;boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt; &gt;]’:
  transform.cpp:11:92:   required from here
  /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/bits/stl_algo.h:4202:12: error: cannot convert ‘boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;::sig&lt;boost::tuples::tuple&lt;long long unsigned int&amp;, long long unsigned int&amp;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;::type {aka boost::lambda::detail::return_type_deduction_failure&lt;boost::lambda::detail::return_type_2_arithmetic_phase_3&lt;long long unsigned int, long long unsigned int&gt; &gt;}’ to ‘long long unsigned int’ in assignment
    *__result = __binary_op(*__first1, *__first2);
              ^
  In file included from /opt/win64/include/boost/lambda/lambda.hpp:22:0,
                   from transform.cpp:1:
  /opt/win64/include/boost/lambda/detail/operator_lambda_func_base.hpp: In instantiation of ‘RET boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, Args&gt;::call(A&amp;, B&amp;, C&amp;, Env&amp;) const [with RET = boost::lambda::detail::return_type_deduction_failure&lt;boost::lambda::detail::return_type_2_arithmetic_phase_3&lt;long long unsigned int, long long unsigned int&gt; &gt;; A = long long unsigned int; B = long long unsigned int; C = const boost::tuples::null_type; Env = const boost::tuples::null_type; Args = boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt;]’:
  /opt/win64/include/boost/lambda/detail/lambda_functors.hpp:211:39:   required from ‘typename boost::lambda::lambda_functor&lt;Base&gt;::inherited::sig&lt;boost::tuples::tuple&lt;A&amp;, B&amp;&gt; &gt;::type boost::lambda::lambda_functor&lt;Base&gt;::operator()(A&amp;, B&amp;) const [with A = long long unsigned int; B = long long unsigned int; T = boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;; typename boost::lambda::lambda_functor&lt;Base&gt;::inherited::sig&lt;boost::tuples::tuple&lt;A&amp;, B&amp;&gt; &gt;::type = boost::lambda::detail::return_type_deduction_failure&lt;boost::lambda::detail::return_type_2_arithmetic_phase_3&lt;long long unsigned int, long long unsigned int&gt; &gt;]’
  /usr/lib/gcc/x86_64-w64-mingw32/4.9-win32/include/c++/bits/stl_algo.h:4202:46:   required from ‘_OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation) [with _IIter1 = long long unsigned int*; _IIter2 = long long unsigned int*; _OIter = long long unsigned int*; _BinaryOperation = boost::lambda::lambda_functor&lt;boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt; &gt;]’
  transform.cpp:11:92:   required from here
  /opt/win64/include/boost/lambda/detail/operator_lambda_func_base.hpp:160:72: error: could not convert ‘(boost::lambda::detail::select&lt;boost::lambda::placeholder&lt;1&gt;, long long unsigned int, long long unsigned int, const boost::tuples::null_type, const boost::tuples::null_type&gt;((* &amp; boost::tuples::get&lt;0, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::tuples::cons&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type&gt; &gt;((* &amp;((const boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;*)this)-&gt;boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;::args.boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt;::&lt;anonymous&gt;))), (* &amp; a), (* &amp; b), (* &amp; c), (* &amp; env)) + boost::lambda::detail::select&lt;boost::lambda::placeholder&lt;2&gt;, long long unsigned int, long long unsigned int, const boost::tuples::null_type, const boost::tuples::null_type&gt;((* &amp; boost::tuples::get&lt;1, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::tuples::cons&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type&gt; &gt;((* &amp;((const boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;*)this)-&gt;boost::lambda::lambda_functor_base&lt;boost::lambda::arithmetic_action&lt;boost::lambda::plus_action&gt;, boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt; &gt;::args.boost::tuples::tuple&lt;boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;1&gt; &gt;, boost::lambda::lambda_functor&lt;boost::lambda::placeholder&lt;2&gt; &gt;, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type&gt;::&lt;anonymous&gt;))), (* &amp; a), (* &amp; b), (* &amp; c), (* &amp; env)))’ from ‘long long unsigned int’ to ‘boost::lambda::detail::return_type_deduction_failure&lt;boost::lambda::detail::return_type_2_arithmetic_phase_3&lt;long long unsigned int, long long unsigned int&gt; &gt;’
          detail::select(boost::tuples::get&lt;1&gt;(args), CALL_ACTUAL_ARGS); \
                                                                      ^
  /opt/win64/include/boost/lambda/detail/operator_lambda_func_base.hpp:206:1: note: in expansion of macro ‘BOOST_LAMBDA_BINARY_ACTION’
   BOOST_LAMBDA_BINARY_ACTION(+,arithmetic_action&lt;plus_action&gt;)
   ^
  </code></pre>
  
  <p>Yeah, TL;DR</p>
  
  <p>basically something went wrong with <code>boost::lambda::_1 + boost::lambda::_2</code> in combination with <code>size_t</code> (other types like <code>int</code> seem to be OK).</p>
  
  <p>Why is there a problem? is that a bug in boost?</p>