Boost C++ Libraries: Ticket #11702: boost::bind universal reference handling regression https://svn.boost.org/trac10/ticket/11702 <p> The following code compiles with boost-1.57 but not with boost-1.59: </p> <pre class="wiki">#include &lt;boost/function.hpp&gt; #include &lt;boost/bind.hpp&gt; #include &lt;memory&gt; void foo(std::auto_ptr&lt;int&gt;); int main() { boost::function&lt;void(std::auto_ptr&lt;int&gt;)&gt; f = boost::bind(foo, _1); std::auto_ptr&lt;int&gt; p; f(p); } </pre><p> This is due to the new universal reference handling code implemented in boost::bind. </p> <p> The local fix we use is: </p> <pre class="wiki">#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) namespace boost { namespace _bi { template&lt;class A&gt; struct list_add_cref&lt;std::auto_ptr&lt;A&gt; &gt; { typedef std::auto_ptr&lt;A&gt;&amp; type; }; } } #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11702 Trac 1.4.3 Peter Dimov Sat, 03 Oct 2015 23:25:43 GMT <link>https://svn.boost.org/trac10/ticket/11702#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11702#comment:1</guid> <description> <p> Should be fixed in <a class="ext-link" href="https://github.com/boostorg/bind/commit/017258c983c18f86641788e840526a7f82af6370"><span class="icon">​</span>https://github.com/boostorg/bind/commit/017258c983c18f86641788e840526a7f82af6370</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>