Boost C++ Libraries: Ticket #8442: Match std::reference_wrapper functionality https://svn.boost.org/trac10/ticket/8442 <p> boost::reference_wrapper lacks the ability to forward calls the referenced type's operator(), e.g.: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/ref.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;functional&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;iostream&gt;</span><span class="cp"></span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">auto</span> <span class="n">f</span> <span class="o">=</span> <span class="p">[]</span> <span class="p">{</span> <span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;Here&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span> <span class="p">};</span> <span class="c1">//auto rf = boost::ref(f); //No operator() overload.</span> <span class="k">auto</span> <span class="n">rf</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">ref</span><span class="p">(</span><span class="n">f</span><span class="p">);</span> <span class="n">f</span><span class="p">();</span> <span class="n">rf</span><span class="p">();</span> <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="p">}</span> </pre></div></div><p> There are a few other related differences with the standard, e.g. std::reference_wrapper inherits from std::{binary|unary}_function, may have value_type, etc. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8442 Trac 1.4.3 viboes Sat, 05 Oct 2013 10:36:53 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8442#comment:1 https://svn.boost.org/trac10/ticket/8442#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">bind</span> </li> </ul> Ticket