diff options
Diffstat (limited to 'boost/smart_ptr/atomic_shared_ptr.hpp')
-rw-r--r-- | boost/smart_ptr/atomic_shared_ptr.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/boost/smart_ptr/atomic_shared_ptr.hpp b/boost/smart_ptr/atomic_shared_ptr.hpp index 7c485070f8..b863100e53 100644 --- a/boost/smart_ptr/atomic_shared_ptr.hpp +++ b/boost/smart_ptr/atomic_shared_ptr.hpp @@ -63,6 +63,11 @@ public: { } + atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT + : p_( std::move( p ) ), l_ BOOST_DETAIL_SPINLOCK_INIT + { + } + #else atomic_shared_ptr() BOOST_SP_NOEXCEPT @@ -71,8 +76,6 @@ public: std::memcpy( &l_, &init, sizeof( init ) ); } -#endif - atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) : p_( std::move( p ) ) @@ -84,6 +87,8 @@ public: std::memcpy( &l_, &init, sizeof( init ) ); } +#endif + atomic_shared_ptr& operator=( shared_ptr<T> r ) BOOST_SP_NOEXCEPT { boost::detail::spinlock::scoped_lock lock( l_ ); |