Boost C++ Libraries: Ticket #7748: Allow explicit result_type specification for transformed https://svn.boost.org/trac10/ticket/7748 <p> Code like the following doesn't work trunk (and released) transformed: </p> <pre class="wiki">std::vector&lt;int&gt; myList(...); float sum = boost::accumulate(myList | transformed([](int a) { return a * 5; }), 0.f); </pre><p> The following patch &amp; test modifications allow the following syntax: </p> <pre class="wiki">float sum = boost::accumulate(myList | transformed&lt;float&gt;([](int a) { return a * 5.f; }), 0.f); </pre><p> This wouldn't be a problem if result_of used or fell back to decltype, but it seems that won't be available for a while. The proposed syntax could also be helpful when using transformed with functors whose implementations are both unmodifiable and don't follow result_of. </p> <p> Patch has been tested with VC10 and compiled with g++ 4.5 (with and without -std=c++0x) and clang++ (without c++0x). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7748 Trac 1.4.3 nathan.crookston+boost@… Thu, 29 Nov 2012 03:24:12 GMT attachment set https://svn.boost.org/trac10/ticket/7748 https://svn.boost.org/trac10/ticket/7748 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">range.diff</span> </li> </ul> <p> patch for proposed syntax </p> Ticket viboes Tue, 10 Sep 2013 20:35:08 GMT description changed https://svn.boost.org/trac10/ticket/7748#comment:1 https://svn.boost.org/trac10/ticket/7748#comment:1 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/7748?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket viboes Tue, 10 Sep 2013 20:37:27 GMT <link>https://svn.boost.org/trac10/ticket/7748#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7748#comment:2</guid> <description> <p> Have you tried defining BOOST_RESULT_OF_USE_DECLTYPE? This is a know limitation (due to backward compatibility) of result-of. </p> </description> <category>Ticket</category> </item> <item> <author>Nathan Crookston <nathan.crookston+boost@…></author> <pubDate>Fri, 20 Sep 2013 17:13:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7748#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7748#comment:3</guid> <description> <p> BOOST_RESULT_OF_USE_DECLTYPE would be inappropriate in situations where a lacking decltype would cause problems with other libraries (e.g., proto). </p> <p> But since I wrote this ticket, my patch to add a BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK (or similar) was more-or-less accepted. So this ticket should be closed as OBE (or whatever resolutions this trac instance has). </p> <p> Thanks for reminding me of this ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Sun, 09 Mar 2014 00:40:09 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7748#comment:4 https://svn.boost.org/trac10/ticket/7748#comment:4 <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">invalid</span> </li> </ul> <p> The original request was valid. It is no longer valid to make a change to Boost.Range for this issue due to the other fix mentioned above. </p> Ticket