Boost C++ Libraries: Ticket #12447: Need some help with a lambda expression exercize https://svn.boost.org/trac10/ticket/12447 <p> Hi, I am studying "C++ Template Metaprogramming" and stuck in exercise 3-6 which states: </p> <p> "Build a lambda expression that has functionality equivalent to 'twice'. Hint: mpl::apply is a metafunction!" </p> <p> Now twice is defined like so: </p> <div class="wiki-code"><div class="code"><pre><span class="k">template</span><span class="o">&lt;</span><span class="k">class</span> <span class="nc">F</span><span class="p">,</span> <span class="k">class</span> <span class="nc">X</span><span class="o">&gt;</span> <span class="k">struct</span> <span class="nl">twice</span> <span class="p">:</span> <span class="n">mpl</span><span class="o">::</span><span class="n">apply</span><span class="o">&lt;</span> <span class="n">F</span><span class="p">,</span> <span class="k">typename</span> <span class="n">mpl</span><span class="o">::</span><span class="n">apply</span><span class="o">&lt;</span><span class="n">F</span><span class="p">,</span><span class="n">X</span><span class="o">&gt;::</span><span class="n">type</span><span class="o">&gt;</span> <span class="p">{};</span> </pre></div></div><p> The book defines a lambda expression as: "callable metadata. they have 2 basic forms: metafunction classes and placeholder expressions". </p> <p> Thank you for your help! Juan </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12447 Trac 1.4.3 anonymous Thu, 05 Jan 2017 14:02:30 GMT <link>https://svn.boost.org/trac10/ticket/12447#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12447#comment:1</guid> <description> <p> So the twice functionality is alriedy defined? Which help you need? Consider putting some bounty on your ticket using bountysource service <a class="ext-link" href="https://www.bountysource.com/teams/boost-c-libraries/issues?tracker_ids=160301"><span class="icon">​</span>https://www.bountysource.com/teams/boost-c-libraries/issues?tracker_ids=160301</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michel Morin</dc:creator> <pubDate>Thu, 05 Jan 2017 17:46:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12447#comment:2 https://svn.boost.org/trac10/ticket/12447#comment:2 <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> Ticket Michel Morin Thu, 05 Jan 2017 17:46:55 GMT <link>https://svn.boost.org/trac10/ticket/12447#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12447#comment:3</guid> <description> <p> As I said in another ticket, the bug tracker is not the right place to ask the questions. Please try asking your questions on <a class="ext-link" href="http://lists.boost.org/mailman/listinfo.cgi/boost-users"><span class="icon">​</span>Boost-users ML</a> , <a class="ext-link" href="http://stackoverflow.com/"><span class="icon">​</span>StackOverflow</a> , or other sites/services for the next time. </p> </description> <category>Ticket</category> </item> </channel> </rss>