Boost C++ Libraries: Ticket #4832: C++0x lambdas do not work as argument to Boost::Range's transformed adaptor https://svn.boost.org/trac10/ticket/4832 <p> You cannot use lambda functions as parameters to transformed adaptor. At least on Visual Studio 2010. </p> <p> This is due to native inability to take a result_of the lambda function. </p> <p> A simple workaround for Visual Studio 2010 is offered (see attached patch for trunk 66478). If it is applied and checked to work on other compilers, please update. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4832 Trac 1.4.3 Alexander Bessonov <alexbav@…> Wed, 10 Nov 2010 11:22:11 GMT attachment set https://svn.boost.org/trac10/ticket/4832 https://svn.boost.org/trac10/ticket/4832 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">lambda.patch</span> </li> </ul> <p> patch for boost/utility/result_of.hpp </p> Ticket Alexander Bessonov <alexbav@…> Wed, 10 Nov 2010 11:24:27 GMT version changed https://svn.boost.org/trac10/ticket/4832#comment:1 https://svn.boost.org/trac10/ticket/4832#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> </ul> Ticket Neil Groves Sun, 14 Nov 2010 17:43:53 GMT owner, component changed https://svn.boost.org/trac10/ticket/4832#comment:2 https://svn.boost.org/trac10/ticket/4832#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Neil Groves</span> to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>component</strong> <span class="trac-field-old">range</span> → <span class="trac-field-new">utility</span> </li> </ul> <p> I have recently reaalized the solution requires a modification to result_of rather than a change to Boost.Range. </p> Ticket Alexander Bessonov <alexbav@…> Sun, 14 Nov 2010 22:10:20 GMT <link>https://svn.boost.org/trac10/ticket/4832#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4832#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4832#comment:2" title="Comment 2">neilgroves</a>: </p> <blockquote class="citation"> <p> I have recently reaalized the solution requires a modification to result_of rather than a change to Boost.Range. </p> </blockquote> <p> Agree. It seems that range lib in trunk started to use boost's result_of (compared to its own implementation in 1.44). My patch addresses variant with a single argument for VC 2010 and needs to be extended for multiple arguments using standard "preprocessor magic". If I get a working variant for multiple arguments, I will update the ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 11 Feb 2011 03:53:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4832#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4832#comment:4</guid> <description> <p> If the compiler has decltype, most of the logic in result_of is unnecessary. </p> </description> <category>Ticket</category> </item> <item> <author>Michel MORIN <mimomorin@…></author> <pubDate>Sat, 20 Aug 2011 06:58:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4832#comment:5 https://svn.boost.org/trac10/ticket/4832#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> With <code>BOOST_RESULT_OF_USE_DECLTYPE</code>, <code>boost::result_of</code> and C++0x lambdas work fine. Please see the documentation for usage of <code>BOOST_RESULT_OF_USE_DECLTYPE</code>: <a href="http://www.boost.org/doc/libs/1_47_0/libs/utility/utility.htm#result_of">http://www.boost.org/doc/libs/1_47_0/libs/utility/utility.htm#result_of</a> </p> <p> (On Visual Studio 2010, using <code>BOOST_RESULT_OF_USE_DECLTYPE</code> works fine with Boost 1.47 and trunk. But it might not work with older versions of Boost, since <code>BOOST_NO_DECLTYPE</code> is defined for that compiler. ) </p> Ticket