diff options
Diffstat (limited to '3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp b/3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp index 1f50403..36799e6 100644 --- a/3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp +++ b/3rdParty/Boost/src/boost/smart_ptr/shared_array.hpp @@ -69,7 +69,25 @@ public: { } -// generated copy constructor, assignment, destructor are fine +// generated copy constructor, destructor are fine... + +#if defined( BOOST_HAS_RVALUE_REFS ) + +// ... except in C++0x, move disables the implicit copy + + shared_array( shared_array const & r ): px( r.px ), pn( r.pn ) // never throws + { + } + +#endif + + // assignment + + shared_array & operator=( shared_array const & r ) // never throws + { + this_type( r ).swap( *this ); + return *this; + } void reset(T * p = 0) { @@ -113,6 +131,11 @@ public: pn.swap(other.pn); } + void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const + { + return pn.get_deleter( ti ); + } + private: T * px; // contained pointer @@ -140,6 +163,11 @@ template<class T> void swap(shared_array<T> & a, shared_array<T> & b) // never t a.swap(b); } +template< class D, class T > D * get_deleter( shared_array<T> const & p ) +{ + return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID(D) ) ); +} + } // namespace boost #endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) |