Remove uses of BOOST_SP_NOEXCEPT from atomic_shared_ptr.hpp

This commit is contained in:
Peter Dimov
2024-10-02 21:24:00 +03:00
parent 505ed6753d
commit 03e1bb314b

View File

@@ -33,7 +33,7 @@ private:
private: private:
bool compare_exchange( shared_ptr<T>& v, shared_ptr<T> w ) BOOST_SP_NOEXCEPT bool compare_exchange( shared_ptr<T>& v, shared_ptr<T> w ) noexcept
{ {
l_.lock(); l_.lock();
@@ -57,16 +57,16 @@ private:
public: public:
constexpr atomic_shared_ptr() BOOST_SP_NOEXCEPT: l_ BOOST_DETAIL_SPINLOCK_INIT constexpr atomic_shared_ptr() noexcept: l_ BOOST_DETAIL_SPINLOCK_INIT
{ {
} }
atomic_shared_ptr( shared_ptr<T> p ) BOOST_SP_NOEXCEPT atomic_shared_ptr( shared_ptr<T> p ) noexcept
: p_( std::move( p ) ), l_ BOOST_DETAIL_SPINLOCK_INIT : p_( std::move( p ) ), l_ BOOST_DETAIL_SPINLOCK_INIT
{ {
} }
atomic_shared_ptr& operator=( shared_ptr<T> r ) BOOST_SP_NOEXCEPT atomic_shared_ptr& operator=( shared_ptr<T> r ) noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
p_.swap( r ); p_.swap( r );
@@ -74,42 +74,42 @@ public:
return *this; return *this;
} }
BOOST_CONSTEXPR bool is_lock_free() const BOOST_SP_NOEXCEPT BOOST_CONSTEXPR bool is_lock_free() const noexcept
{ {
return false; return false;
} }
shared_ptr<T> load() const BOOST_SP_NOEXCEPT shared_ptr<T> load() const noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
return p_; return p_;
} }
template<class M> shared_ptr<T> load( M ) const BOOST_SP_NOEXCEPT template<class M> shared_ptr<T> load( M ) const noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
return p_; return p_;
} }
operator shared_ptr<T>() const BOOST_SP_NOEXCEPT operator shared_ptr<T>() const noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
return p_; return p_;
} }
void store( shared_ptr<T> r ) BOOST_SP_NOEXCEPT void store( shared_ptr<T> r ) noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
p_.swap( r ); p_.swap( r );
} }
template<class M> void store( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT template<class M> void store( shared_ptr<T> r, M ) noexcept
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
p_.swap( r ); p_.swap( r );
} }
shared_ptr<T> exchange( shared_ptr<T> r ) BOOST_SP_NOEXCEPT shared_ptr<T> exchange( shared_ptr<T> r ) noexcept
{ {
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
@@ -119,7 +119,7 @@ public:
return std::move( r ); return std::move( r );
} }
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 ) noexcept
{ {
{ {
boost::detail::spinlock::scoped_lock lock( l_ ); boost::detail::spinlock::scoped_lock lock( l_ );
@@ -129,62 +129,62 @@ public:
return std::move( r ); return std::move( r );
} }
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 ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) noexcept
{ {
return compare_exchange( v, w ); return compare_exchange( v, w );
} }
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 ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }
template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }
bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }
template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }
bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) noexcept
{ {
return compare_exchange( v, std::move( w ) ); return compare_exchange( v, std::move( w ) );
} }