diff options
Diffstat (limited to 'contrib/src/boost/smart_ptr/shared_ptr.hpp')
-rw-r--r-- | contrib/src/boost/smart_ptr/shared_ptr.hpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/contrib/src/boost/smart_ptr/shared_ptr.hpp b/contrib/src/boost/smart_ptr/shared_ptr.hpp index 47bc33d..77f68be 100644 --- a/contrib/src/boost/smart_ptr/shared_ptr.hpp +++ b/contrib/src/boost/smart_ptr/shared_ptr.hpp @@ -642,6 +642,14 @@ public: return *this; } + // aliasing move + template<class Y> + shared_ptr( shared_ptr<Y> && r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn() + { + pn.swap( r.pn ); + r.px = 0; + } + #endif #if !defined( BOOST_NO_CXX11_NULLPTR ) @@ -679,7 +687,16 @@ public: { this_type( r, p ).swap( *this ); } - + +#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) + + template<class Y> void reset( shared_ptr<Y> && r, element_type * p ) + { + this_type( static_cast< shared_ptr<Y> && >( r ), p ).swap( *this ); + } + +#endif + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_dereference< T >::type operator* () const { @@ -1065,7 +1082,7 @@ template< class T > struct hash; template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p ) BOOST_NOEXCEPT { - return boost::hash< T* >()( p.get() ); + return boost::hash< typename boost::shared_ptr<T>::element_type* >()( p.get() ); } } // namespace boost |