Boost C++ Libraries: Ticket #6590: BOOST_AUTO fails on C++11 lambdas https://svn.boost.org/trac10/ticket/6590 <p> <code>BOOST_AUTO</code> fails on C++11 lambdas as follows (tested with g++ 4.6.2-14ubuntu2): </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/typeof/typeof.hpp&gt;</span><span class="cp"></span> <span class="n">BOOST_AUTO</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">[](){});</span> </pre></div></div><pre class="wiki">$ g++ -c -std=c++0x test.cc test.cc:2:1: error: lambda-expression in unevaluated context test.cc:2:1: error: conversion from ‘&lt;lambda()&gt;’ to non-scalar type ‘&lt;lambda()&gt;’ requested </pre><p> Although it’s apparently not possible to use <code>typeof</code> or <code>decltype</code> on a lambda expression, this could be fixed by defining <code>BOOST_AUTO</code> with C++11 <code>auto</code> on compilers that support it: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#define BOOST_AUTO(Var, Expr) auto Var = Expr</span> <span class="n">BOOST_AUTO</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="p">[](){});</span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6590 Trac 1.4.3