mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-07-30 20:57:21 +02:00
Remove uses of BOOST_NO_CXX11_RVALUE_REFERENCES
This commit is contained in:
@ -77,11 +77,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT
|
atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
: p_( std::move( p ) )
|
: p_( std::move( p ) )
|
||||||
#else
|
|
||||||
: p_( p )
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT;
|
boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT;
|
||||||
std::memcpy( &l_, &init, sizeof( init ) );
|
std::memcpy( &l_, &init, sizeof( init ) );
|
||||||
@ -139,15 +135,7 @@ public:
|
|||||||
p_.swap( r );
|
p_.swap( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
return std::move( r );
|
return std::move( r );
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
return r;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT
|
template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT
|
||||||
@ -157,15 +145,7 @@ public:
|
|||||||
p_.swap( r );
|
p_.swap( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
return std::move( r );
|
return std::move( r );
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
return r;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT
|
||||||
@ -198,8 +178,6 @@ public:
|
|||||||
return compare_exchange( v, w );
|
return compare_exchange( v, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT
|
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
@ -229,8 +207,6 @@ public:
|
|||||||
{
|
{
|
||||||
return compare_exchange( v, std::move( w ) );
|
return compare_exchange( v, std::move( w ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
@ -105,14 +105,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
explicit local_counted_impl( shared_count && pn ) BOOST_SP_NOEXCEPT: pn_( std::move(pn) )
|
explicit local_counted_impl( shared_count && pn ) BOOST_SP_NOEXCEPT: pn_( std::move(pn) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void local_cb_destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE
|
void local_cb_destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
|
@ -42,14 +42,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
explicit local_sp_deleter( D&& d ) BOOST_SP_NOEXCEPT: d_( std::move(d) )
|
explicit local_sp_deleter( D&& d ) BOOST_SP_NOEXCEPT: d_( std::move(d) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
D& deleter() BOOST_SP_NOEXCEPT
|
D& deleter() BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return d_;
|
return d_;
|
||||||
|
@ -424,8 +424,6 @@ public:
|
|||||||
if( pi_ != 0 ) pi_->add_ref_copy();
|
if( pi_ != 0 ) pi_->add_ref_copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
shared_count(shared_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
|
shared_count(shared_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
|
||||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(shared_count_id)
|
, id_(shared_count_id)
|
||||||
@ -434,8 +432,6 @@ public:
|
|||||||
r.pi_ = 0;
|
r.pi_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
|
explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
|
||||||
shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT; // constructs an empty *this when r.use_count() == 0
|
shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT; // constructs an empty *this when r.use_count() == 0
|
||||||
|
|
||||||
@ -550,8 +546,6 @@ public:
|
|||||||
|
|
||||||
// Move support
|
// Move support
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
weak_count(weak_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
|
weak_count(weak_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
|
||||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||||
, id_(weak_count_id)
|
, id_(weak_count_id)
|
||||||
@ -560,8 +554,6 @@ public:
|
|||||||
r.pi_ = 0;
|
r.pi_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
~weak_count() /*BOOST_SP_NOEXCEPT*/
|
~weak_count() /*BOOST_SP_NOEXCEPT*/
|
||||||
{
|
{
|
||||||
if(pi_ != 0) pi_->weak_release();
|
if(pi_ != 0) pi_->weak_release();
|
||||||
|
@ -149,20 +149,10 @@ public:
|
|||||||
|
|
||||||
// pre: d(p) must not throw
|
// pre: d(p) must not throw
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
sp_counted_impl_pd( P p, D & d ): ptr( p ), del( static_cast< D&& >( d ) )
|
sp_counted_impl_pd( P p, D & d ): ptr( p ), del( static_cast< D&& >( d ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
sp_counted_impl_pd( P p, D & d ): ptr( p ), del( d )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sp_counted_impl_pd( P p ): ptr( p ), del()
|
sp_counted_impl_pd( P p ): ptr( p ), del()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -233,20 +223,10 @@ public:
|
|||||||
|
|
||||||
// pre: d( p ) must not throw
|
// pre: d( p ) must not throw
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( static_cast< D&& >( d ) ), a_( a )
|
sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( static_cast< D&& >( d ) ), a_( a )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( d ), a_( a )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sp_counted_impl_pda( P p, A a ): p_( p ), d_( a ), a_( a )
|
sp_counted_impl_pda( P p, A a ): p_( p ), d_( a ), a_( a )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -85,8 +85,6 @@ public:
|
|||||||
|
|
||||||
// Move support
|
// Move support
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px )
|
intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px )
|
||||||
{
|
{
|
||||||
rhs.px = 0;
|
rhs.px = 0;
|
||||||
@ -114,8 +112,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
intrusive_ptr & operator=(intrusive_ptr const & rhs)
|
intrusive_ptr & operator=(intrusive_ptr const & rhs)
|
||||||
{
|
{
|
||||||
this_type(rhs).swap(*this);
|
this_type(rhs).swap(*this);
|
||||||
@ -266,8 +262,6 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U
|
|||||||
return dynamic_cast<T *>(p.get());
|
return dynamic_cast<T *>(p.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T, class U> intrusive_ptr<T> static_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT
|
template<class T, class U> intrusive_ptr<T> static_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false );
|
return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false );
|
||||||
@ -289,8 +283,6 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// operator<<
|
// operator<<
|
||||||
|
|
||||||
template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
|
template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y> const & p)
|
||||||
|
@ -189,8 +189,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y> local_shared_ptr( shared_ptr<Y> && r,
|
template<class Y> local_shared_ptr( shared_ptr<Y> && r,
|
||||||
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
|
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
|
||||||
: px( r.get() ), pn( 0 )
|
: px( r.get() ), pn( 0 )
|
||||||
@ -204,12 +202,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// construction from unique_ptr
|
// construction from unique_ptr
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template< class Y, class D >
|
template< class Y, class D >
|
||||||
local_shared_ptr( std::unique_ptr< Y, D > && r,
|
local_shared_ptr( std::unique_ptr< Y, D > && r,
|
||||||
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
|
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() )
|
||||||
@ -223,8 +217,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template< class Y, class D >
|
template< class Y, class D >
|
||||||
local_shared_ptr( boost::movelib::unique_ptr< Y, D > r ); // !
|
local_shared_ptr( boost::movelib::unique_ptr< Y, D > r ); // !
|
||||||
// : px( r.get() ), pn( new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) ) ) )
|
// : px( r.get() ), pn( new boost::detail::local_counted_impl( shared_ptr<T>( std::move(r) ) ) )
|
||||||
@ -244,16 +236,12 @@ public:
|
|||||||
|
|
||||||
// move constructor
|
// move constructor
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
local_shared_ptr( local_shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
local_shared_ptr( local_shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||||
{
|
{
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
r.pn = 0;
|
r.pn = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// converting copy constructor
|
// converting copy constructor
|
||||||
|
|
||||||
template<class Y> local_shared_ptr( local_shared_ptr<Y> const & r,
|
template<class Y> local_shared_ptr( local_shared_ptr<Y> const & r,
|
||||||
@ -270,8 +258,6 @@ public:
|
|||||||
|
|
||||||
// converting move constructor
|
// converting move constructor
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y> local_shared_ptr( local_shared_ptr<Y> && r,
|
template<class Y> local_shared_ptr( local_shared_ptr<Y> && r,
|
||||||
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT
|
typename boost::detail::sp_enable_if_convertible<Y, T>::type = boost::detail::sp_empty() ) BOOST_SP_NOEXCEPT
|
||||||
: px( r.px ), pn( r.pn )
|
: px( r.px ), pn( r.pn )
|
||||||
@ -282,8 +268,6 @@ public:
|
|||||||
r.pn = 0;
|
r.pn = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// aliasing
|
// aliasing
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
@ -295,8 +279,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
local_shared_ptr( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn )
|
local_shared_ptr( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn )
|
||||||
{
|
{
|
||||||
@ -304,8 +286,6 @@ public:
|
|||||||
r.pn = 0;
|
r.pn = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
|
|
||||||
local_shared_ptr & operator=( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT
|
local_shared_ptr & operator=( local_shared_ptr const & r ) BOOST_SP_NOEXCEPT
|
||||||
@ -320,8 +300,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
local_shared_ptr & operator=( local_shared_ptr && r ) BOOST_SP_NOEXCEPT
|
local_shared_ptr & operator=( local_shared_ptr && r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
local_shared_ptr( std::move( r ) ).swap( *this );
|
local_shared_ptr( std::move( r ) ).swap( *this );
|
||||||
@ -335,16 +313,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
local_shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT
|
local_shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
local_shared_ptr().swap(*this);
|
local_shared_ptr().swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y, class D>
|
template<class Y, class D>
|
||||||
local_shared_ptr & operator=( std::unique_ptr<Y, D> && r )
|
local_shared_ptr & operator=( std::unique_ptr<Y, D> && r )
|
||||||
{
|
{
|
||||||
@ -352,8 +326,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y, class D>
|
template<class Y, class D>
|
||||||
local_shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r ); // !
|
local_shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r ); // !
|
||||||
|
|
||||||
@ -384,15 +356,11 @@ public:
|
|||||||
local_shared_ptr( r, p ).swap( *this );
|
local_shared_ptr( r, p ).swap( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y> void reset( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT
|
template<class Y> void reset( local_shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
local_shared_ptr( std::move( r ), p ).swap( *this );
|
local_shared_ptr( std::move( r ), p ).swap( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// accessors
|
// accessors
|
||||||
|
|
||||||
typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT
|
typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT
|
||||||
@ -587,8 +555,6 @@ template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_s
|
|||||||
return local_shared_ptr<T>( r, p );
|
return local_shared_ptr<T>( r, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
|
template<class T, class U> local_shared_ptr<T> static_pointer_cast( local_shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
(void) static_cast< T* >( static_cast< U* >( 0 ) );
|
(void) static_cast< T* >( static_cast< U* >( 0 ) );
|
||||||
@ -629,8 +595,6 @@ template<class T, class U> local_shared_ptr<T> reinterpret_pointer_cast( local_s
|
|||||||
return local_shared_ptr<T>( std::move(r), p );
|
return local_shared_ptr<T>( std::move(r), p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// get_pointer() enables boost::mem_fn to recognize local_shared_ptr
|
// get_pointer() enables boost::mem_fn to recognize local_shared_ptr
|
||||||
|
|
||||||
template<class T> inline typename local_shared_ptr<T>::element_type * get_pointer( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
|
template<class T> inline typename local_shared_ptr<T>::element_type * get_pointer( local_shared_ptr<T> const & p ) BOOST_SP_NOEXCEPT
|
||||||
|
@ -82,9 +82,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generated copy constructor, destructor are fine...
|
// generated copy constructor, destructor are fine...
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// ... except in C++0x, move disables the implicit copy
|
// ... except in C++0x, move disables the implicit copy
|
||||||
|
|
||||||
shared_array( shared_array const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
shared_array( shared_array const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||||
@ -97,8 +94,6 @@ public:
|
|||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// conversion
|
// conversion
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
@ -130,8 +125,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
shared_array & operator=( shared_array && r ) BOOST_SP_NOEXCEPT
|
shared_array & operator=( shared_array && r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
this_type( static_cast< shared_array && >( r ) ).swap( *this );
|
this_type( static_cast< shared_array && >( r ) ).swap( *this );
|
||||||
@ -145,8 +138,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void reset() BOOST_SP_NOEXCEPT
|
void reset() BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
this_type().swap( *this );
|
this_type().swap( *this );
|
||||||
|
@ -290,14 +290,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( std::move( pn_ ) )
|
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( std::move( pn_ ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
explicit shared_ptr( Y * p ): px( p ), pn() // Y must be complete
|
explicit shared_ptr( Y * p ): px( p ), pn() // Y must be complete
|
||||||
{
|
{
|
||||||
@ -310,80 +306,33 @@ public:
|
|||||||
// shared_ptr will release p by calling d(p)
|
// shared_ptr will release p by calling d(p)
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
|
template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
|
||||||
{
|
{
|
||||||
boost::detail::sp_deleter_construct( this, p );
|
boost::detail::sp_deleter_construct( this, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, d )
|
|
||||||
{
|
|
||||||
boost::detail::sp_deleter_construct( this, p );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class D> shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
|
template<class D> shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<class D> shared_ptr( std::nullptr_t p, D d ): px( p ), pn( p, d )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// As above, but with allocator. A's copy constructor shall not throw.
|
// As above, but with allocator. A's copy constructor shall not throw.
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
|
template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
|
||||||
{
|
{
|
||||||
boost::detail::sp_deleter_construct( this, p );
|
boost::detail::sp_deleter_construct( this, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a )
|
|
||||||
{
|
|
||||||
boost::detail::sp_deleter_construct( this, p );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class D, class A> shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
|
template<class D, class A> shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<class D, class A> shared_ptr( std::nullptr_t p, D d, A a ): px( p ), pn( p, d, a )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// generated copy constructor, destructor are fine...
|
// generated copy constructor, destructor are fine...
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// ... except in C++0x, move disables the implicit copy
|
// ... except in C++0x, move disables the implicit copy
|
||||||
|
|
||||||
shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
shared_ptr( shared_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
explicit shared_ptr( weak_ptr<Y> const & r ): pn( r.pn ) // may throw
|
explicit shared_ptr( weak_ptr<Y> const & r ): pn( r.pn ) // may throw
|
||||||
{
|
{
|
||||||
@ -429,8 +378,6 @@ public:
|
|||||||
boost::detail::sp_deleter_construct( this, tmp );
|
boost::detail::sp_deleter_construct( this, tmp );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
|
shared_ptr( std::auto_ptr<Y> && r ): px(r.get()), pn()
|
||||||
{
|
{
|
||||||
@ -442,27 +389,8 @@ public:
|
|||||||
boost::detail::sp_deleter_construct( this, tmp );
|
boost::detail::sp_deleter_construct( this, tmp );
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
|
||||||
|
|
||||||
template<class Ap>
|
|
||||||
explicit shared_ptr( Ap r, typename boost::detail::sp_enable_if_auto_ptr<Ap, int>::type = 0 ): px( r.get() ), pn()
|
|
||||||
{
|
|
||||||
typedef typename Ap::element_type Y;
|
|
||||||
|
|
||||||
boost::detail::sp_assert_convertible< Y, T >();
|
|
||||||
|
|
||||||
Y * tmp = r.get();
|
|
||||||
pn = boost::detail::shared_count( r );
|
|
||||||
|
|
||||||
boost::detail::sp_deleter_construct( this, tmp );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_NO_SFINAE, BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
#endif // BOOST_NO_AUTO_PTR
|
#endif // BOOST_NO_AUTO_PTR
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template< class Y, class D >
|
template< class Y, class D >
|
||||||
shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn()
|
shared_ptr( std::unique_ptr< Y, D > && r ): px( r.get() ), pn()
|
||||||
{
|
{
|
||||||
@ -477,8 +405,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template< class Y, class D >
|
template< class Y, class D >
|
||||||
shared_ptr( boost::movelib::unique_ptr< Y, D > r ): px( r.get() ), pn()
|
shared_ptr( boost::movelib::unique_ptr< Y, D > r ): px( r.get() ), pn()
|
||||||
{
|
{
|
||||||
@ -517,8 +443,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
shared_ptr & operator=( std::auto_ptr<Y> && r )
|
shared_ptr & operator=( std::auto_ptr<Y> && r )
|
||||||
{
|
{
|
||||||
@ -526,21 +450,8 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
|
||||||
|
|
||||||
template<class Ap>
|
|
||||||
typename boost::detail::sp_enable_if_auto_ptr< Ap, shared_ptr & >::type operator=( Ap r )
|
|
||||||
{
|
|
||||||
this_type( r ).swap( *this );
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // BOOST_NO_SFINAE, BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
#endif // BOOST_NO_AUTO_PTR
|
#endif // BOOST_NO_AUTO_PTR
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y, class D>
|
template<class Y, class D>
|
||||||
shared_ptr & operator=( std::unique_ptr<Y, D> && r )
|
shared_ptr & operator=( std::unique_ptr<Y, D> && r )
|
||||||
{
|
{
|
||||||
@ -548,8 +459,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y, class D>
|
template<class Y, class D>
|
||||||
shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
|
shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
|
||||||
{
|
{
|
||||||
@ -576,8 +485,6 @@ public:
|
|||||||
|
|
||||||
// Move support
|
// Move support
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
|
shared_ptr( shared_ptr && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( static_cast< boost::detail::shared_count && >( r.pn ) )
|
||||||
{
|
{
|
||||||
r.px = 0;
|
r.px = 0;
|
||||||
@ -612,8 +519,6 @@ public:
|
|||||||
r.px = 0;
|
r.px = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT
|
shared_ptr & operator=( std::nullptr_t ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
this_type().swap(*this);
|
this_type().swap(*this);
|
||||||
@ -631,8 +536,6 @@ public:
|
|||||||
this_type( p ).swap( *this );
|
this_type( p ).swap( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y, class D> void reset( Y * p, D d )
|
template<class Y, class D> void reset( Y * p, D d )
|
||||||
{
|
{
|
||||||
this_type( p, static_cast< D&& >( d ) ).swap( *this );
|
this_type( p, static_cast< D&& >( d ) ).swap( *this );
|
||||||
@ -643,34 +546,16 @@ public:
|
|||||||
this_type( p, static_cast< D&& >( d ), a ).swap( *this );
|
this_type( p, static_cast< D&& >( d ), a ).swap( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
template<class Y, class D> void reset( Y * p, D d )
|
|
||||||
{
|
|
||||||
this_type( p, d ).swap( *this );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Y, class D, class A> void reset( Y * p, D d, A a )
|
|
||||||
{
|
|
||||||
this_type( p, d, a ).swap( *this );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y> void reset( shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT
|
template<class Y> void reset( shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
this_type( r, p ).swap( *this );
|
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 ) BOOST_SP_NOEXCEPT
|
template<class Y> void reset( shared_ptr<Y> && r, element_type * p ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
this_type( static_cast< shared_ptr<Y> && >( r ), p ).swap( *this );
|
this_type( static_cast< shared_ptr<Y> && >( r ), p ).swap( *this );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT_WITH_ASSERT
|
typename boost::detail::sp_dereference< T >::type operator* () const BOOST_SP_NOEXCEPT_WITH_ASSERT
|
||||||
{
|
{
|
||||||
BOOST_ASSERT( px != 0 );
|
BOOST_ASSERT( px != 0 );
|
||||||
@ -856,8 +741,6 @@ template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U>
|
|||||||
return shared_ptr<T>( r, p );
|
return shared_ptr<T>( r, p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
|
template<class T, class U> shared_ptr<T> static_pointer_cast( shared_ptr<U> && r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
(void) static_cast< T* >( static_cast< U* >( 0 ) );
|
(void) static_cast< T* >( static_cast< U* >( 0 ) );
|
||||||
@ -898,8 +781,6 @@ template<class T, class U> shared_ptr<T> reinterpret_pointer_cast( shared_ptr<U>
|
|||||||
return shared_ptr<T>( std::move(r), p );
|
return shared_ptr<T>( std::move(r), p );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// get_pointer() enables boost::mem_fn to recognize shared_ptr
|
// get_pointer() enables boost::mem_fn to recognize shared_ptr
|
||||||
|
|
||||||
template<class T> inline typename shared_ptr<T>::element_type * get_pointer(shared_ptr<T> const & p) BOOST_SP_NOEXCEPT
|
template<class T> inline typename shared_ptr<T>::element_type * get_pointer(shared_ptr<T> const & p) BOOST_SP_NOEXCEPT
|
||||||
|
@ -38,9 +38,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generated copy constructor, assignment, destructor are fine...
|
// generated copy constructor, assignment, destructor are fine...
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
// ... except in C++0x, move disables the implicit copy
|
// ... except in C++0x, move disables the implicit copy
|
||||||
|
|
||||||
weak_ptr( weak_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
weak_ptr( weak_ptr const & r ) BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||||
@ -54,8 +51,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// The "obvious" converting constructor implementation:
|
// The "obvious" converting constructor implementation:
|
||||||
//
|
//
|
||||||
@ -80,8 +75,6 @@ public:
|
|||||||
boost::detail::sp_assert_convertible< Y, T >();
|
boost::detail::sp_assert_convertible< Y, T >();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||||
BOOST_SP_NOEXCEPT : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) )
|
BOOST_SP_NOEXCEPT : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) )
|
||||||
@ -105,8 +98,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
|
||||||
BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
BOOST_SP_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||||
@ -123,14 +114,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y> weak_ptr(weak_ptr<Y> && r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( std::move( r.pn ) )
|
template<class Y> weak_ptr(weak_ptr<Y> && r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( std::move( r.pn ) )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr & operator=( weak_ptr<Y> const & r ) BOOST_SP_NOEXCEPT
|
weak_ptr & operator=( weak_ptr<Y> const & r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
@ -142,8 +129,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr & operator=( weak_ptr<Y> && r ) BOOST_SP_NOEXCEPT
|
weak_ptr & operator=( weak_ptr<Y> && r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
@ -151,8 +136,6 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template<class Y>
|
template<class Y>
|
||||||
weak_ptr & operator=( shared_ptr<Y> const & r ) BOOST_SP_NOEXCEPT
|
weak_ptr & operator=( shared_ptr<Y> const & r ) BOOST_SP_NOEXCEPT
|
||||||
{
|
{
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
namespace N
|
namespace N
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -245,12 +243,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -407,8 +407,6 @@ static void copy_constructor()
|
|||||||
|
|
||||||
// move constructor
|
// move constructor
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T> static void empty_move_test()
|
template<class T> static void empty_move_test()
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2(( boost::local_shared_ptr<T>() ));
|
boost::local_shared_ptr<T> p2(( boost::local_shared_ptr<T>() ));
|
||||||
@ -489,14 +487,6 @@ static void move_constructor()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void move_constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// aliasing constructor
|
// aliasing constructor
|
||||||
|
|
||||||
template<class T, class U> void test_aliasing_( boost::local_shared_ptr<T> const & p1, U * p2 )
|
template<class T, class U> void test_aliasing_( boost::local_shared_ptr<T> const & p1, U * p2 )
|
||||||
@ -720,8 +710,6 @@ static void shared_ptr_copy_constructor()
|
|||||||
|
|
||||||
// shared_ptr_move constructor
|
// shared_ptr_move constructor
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T> static void empty_shared_ptr_move_test()
|
template<class T> static void empty_shared_ptr_move_test()
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2(( boost::shared_ptr<T>() ));
|
boost::local_shared_ptr<T> p2(( boost::shared_ptr<T>() ));
|
||||||
@ -801,18 +789,8 @@ static void shared_ptr_move_constructor()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void shared_ptr_move_constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// unique_ptr_constructor
|
// unique_ptr_constructor
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T, class U> static void test_null_unique_ptr( std::unique_ptr<U> && p1 )
|
template<class T, class U> static void test_null_unique_ptr( std::unique_ptr<U> && p1 )
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2( std::move( p1 ) );
|
boost::local_shared_ptr<T> p2( std::move( p1 ) );
|
||||||
@ -914,14 +892,6 @@ static void unique_ptr_constructor()
|
|||||||
deleter_unique_ptr_test<void>();
|
deleter_unique_ptr_test<void>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void unique_ptr_constructor()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// copy assignment
|
// copy assignment
|
||||||
|
|
||||||
template<class T> static void empty_copy_assign_test()
|
template<class T> static void empty_copy_assign_test()
|
||||||
@ -1079,8 +1049,6 @@ static void copy_assignment()
|
|||||||
|
|
||||||
// move assignment
|
// move assignment
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T> static void empty_move_assign_test()
|
template<class T> static void empty_move_assign_test()
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2;
|
boost::local_shared_ptr<T> p2;
|
||||||
@ -1219,14 +1187,6 @@ static void move_assignment()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void move_assignment()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// nullptr assignment
|
// nullptr assignment
|
||||||
|
|
||||||
template<class T> static void test_nullptr_assign( boost::local_shared_ptr<T> p1 )
|
template<class T> static void test_nullptr_assign( boost::local_shared_ptr<T> p1 )
|
||||||
@ -1494,8 +1454,6 @@ static void shared_ptr_copy_assignment()
|
|||||||
|
|
||||||
// shared_ptr_move assignment
|
// shared_ptr_move assignment
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
template<class T> static void empty_shared_ptr_move_assign_test()
|
template<class T> static void empty_shared_ptr_move_assign_test()
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2;
|
boost::local_shared_ptr<T> p2;
|
||||||
@ -1639,18 +1597,8 @@ static void shared_ptr_move_assignment()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void shared_ptr_move_assignment()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// unique_ptr assignment
|
// unique_ptr assignment
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) && !defined( BOOST_NO_CXX11_SMART_PTR )
|
|
||||||
|
|
||||||
template<class T> static void empty_unique_ptr_assign_test()
|
template<class T> static void empty_unique_ptr_assign_test()
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<T> p2;
|
boost::local_shared_ptr<T> p2;
|
||||||
@ -1791,14 +1739,6 @@ static void unique_ptr_assignment()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static void unique_ptr_assignment()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// pointer reset
|
// pointer reset
|
||||||
|
|
||||||
template<class T, class U> static void test_pointer_reset( boost::local_shared_ptr<U> p2 )
|
template<class T, class U> static void test_pointer_reset( boost::local_shared_ptr<U> p2 )
|
||||||
|
@ -194,8 +194,6 @@ int main()
|
|||||||
BOOST_TEST( wp5.lock() == 0 );
|
BOOST_TEST( wp5.lock() == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
{
|
{
|
||||||
std::unique_ptr<X[]> px( new X[ 4 ] );
|
std::unique_ptr<X[]> px( new X[ 4 ] );
|
||||||
BOOST_TEST( X::allocations == 1 );
|
BOOST_TEST( X::allocations == 1 );
|
||||||
@ -255,8 +253,6 @@ int main()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::local_shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
boost::local_shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
||||||
BOOST_TEST( X::allocations == 1 );
|
BOOST_TEST( X::allocations == 1 );
|
||||||
|
@ -64,13 +64,11 @@ int main()
|
|||||||
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(boost::move(a));
|
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(boost::move(a));
|
||||||
BOOST_TEST( x->constructed_by_ == ByRef::move_constructor);
|
BOOST_TEST( x->constructed_by_ == ByRef::move_constructor);
|
||||||
}
|
}
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
{
|
{
|
||||||
boost::shared_ptr< ByVal > x = boost::make_shared< ByVal >(movearg());
|
boost::shared_ptr< ByVal > x = boost::make_shared< ByVal >(movearg());
|
||||||
boost::shared_ptr< ByRef > y = boost::make_shared< ByRef >(movearg());
|
boost::shared_ptr< ByRef > y = boost::make_shared< ByRef >(movearg());
|
||||||
BOOST_TEST( y->constructed_by_ == ByRef::move_constructor);
|
BOOST_TEST( y->constructed_by_ == ByRef::move_constructor);
|
||||||
}
|
}
|
||||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
{
|
{
|
||||||
const movearg ca;
|
const movearg ca;
|
||||||
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(ca);
|
boost::shared_ptr< ByRef > x = boost::make_shared< ByRef >(ca);
|
||||||
|
@ -12,15 +12,6 @@
|
|||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
class myarg
|
class myarg
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -94,5 +85,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#include <boost/config.hpp>
|
|
||||||
|
|
||||||
// shared_ptr_alias_move_test.cpp
|
// shared_ptr_alias_move_test.cpp
|
||||||
//
|
//
|
||||||
// Copyright (c) 2007 Peter Dimov
|
// Copyright (c) 2007 Peter Dimov
|
||||||
@ -8,13 +6,11 @@
|
|||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
|
||||||
#include <boost/core/lightweight_test.hpp>
|
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
class incomplete;
|
class incomplete;
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
@ -244,12 +240,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
{
|
{
|
||||||
static long instances;
|
static long instances;
|
||||||
@ -96,12 +94,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -11,8 +11,6 @@
|
|||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
{};
|
{};
|
||||||
|
|
||||||
@ -95,12 +93,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
@ -194,8 +194,6 @@ int main()
|
|||||||
BOOST_TEST( wp5.lock() == 0 );
|
BOOST_TEST( wp5.lock() == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
{
|
{
|
||||||
std::unique_ptr<X[]> px( new X[ 4 ] );
|
std::unique_ptr<X[]> px( new X[ 4 ] );
|
||||||
BOOST_TEST( X::allocations == 1 );
|
BOOST_TEST( X::allocations == 1 );
|
||||||
@ -255,8 +253,6 @@ int main()
|
|||||||
BOOST_TEST( X::instances == 0 );
|
BOOST_TEST( X::instances == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
boost::shared_ptr<X[]> px( new X[ 5 ], array_deleter< X >() );
|
||||||
BOOST_TEST( X::allocations == 1 );
|
BOOST_TEST( X::allocations == 1 );
|
||||||
|
@ -9,13 +9,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
struct Y
|
struct Y
|
||||||
{
|
{
|
||||||
static int instances;
|
static int instances;
|
||||||
@ -145,5 +138,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
struct X: public boost::enable_shared_from_this< X >
|
struct X: public boost::enable_shared_from_this< X >
|
||||||
{
|
{
|
||||||
static int instances;
|
static int instances;
|
||||||
@ -283,12 +281,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // !defined( BOOST_NO_CXX11_SMART_PTR ) && !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -9,23 +9,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_SMART_PTR )
|
|
||||||
|
|
||||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_SMART_PTR is defined")
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#elif defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#elif defined(BOOST_MSVC) && BOOST_MSVC < 1700
|
|
||||||
|
|
||||||
BOOST_PRAGMA_MESSAGE("Skipping test because msvc-10.0 unique_ptr doesn't support move-only deleters")
|
|
||||||
int main() {}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
struct Y
|
struct Y
|
||||||
{
|
{
|
||||||
static int instances;
|
static int instances;
|
||||||
@ -149,5 +132,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -8,15 +8,13 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
|
||||||
#include <boost/core/lightweight_test.hpp>
|
|
||||||
#include <boost/weak_ptr.hpp>
|
#include <boost/weak_ptr.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
class incomplete;
|
class incomplete;
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
@ -86,12 +84,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
#include <boost/core/lightweight_test.hpp>
|
#include <boost/core/lightweight_test.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
{
|
{
|
||||||
static long instances;
|
static long instances;
|
||||||
@ -111,12 +109,3 @@ int main()
|
|||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user