Boost logo

Boost :

Subject: [boost] [smart_ptr] make_shared perfect forwarding bug
From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2009-04-18 19:03:09


Perfect forwarding doesn't seem to work quite correctly with
boost::make_shared. The attached program, which tries to pass a move-only
type through make_shared fails to compile with gcc in c++0x mode. To fix
it, I had to change the definition of detail::forward in make_shared.hpp
to use rvalue references:

#if defined( BOOST_HAS_RVALUE_REFS )
template< class T > T&& forward( T &&t )
{
    return t;
}
#endif

This is just based on looking at how gcc implements std::forward. Is this
the right fix?






Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk