[Boost-bugs] [Boost C++ Libraries] #11702: boost::bind universal reference handling regression

Subject: [Boost-bugs] [Boost C++ Libraries] #11702: boost::bind universal reference handling regression
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-01 11:16:54


#11702: boost::bind universal reference handling regression
---------------------------------+------------------------
 Reporter: maxim.yegorushkin@… | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: bind
  Version: Boost 1.59.0 | Severity: Regression
 Keywords: bind, auto_ptr |
---------------------------------+------------------------
 The following code compiles with boost-1.57 but not with boost-1.59:

 {{{
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
 #include <memory>

 void foo(std::auto_ptr<int>);

 int main() {
     boost::function<void(std::auto_ptr<int>)> f = boost::bind(foo, _1);
     std::auto_ptr<int> p;
     f(p);
 }
 }}}

 This is due to the new universal reference handling code implemented in
 boost::bind.

 The local fix we use is:

 {{{
 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )

 namespace boost { namespace _bi {

 template<class A> struct list_add_cref<std::auto_ptr<A> >
 {
     typedef std::auto_ptr<A>& type;
 };

 } }

 #endif
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11702>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC