Remove uses of BOOST_SP_NOEXCEPT from intrusive_ptr.hpp

This commit is contained in:
Peter Dimov
2024-10-02 21:28:06 +03:00
parent 96ef19e72d
commit 62fd6baa48

View File

@ -51,7 +51,7 @@ public:
typedef T element_type; typedef T element_type;
BOOST_CONSTEXPR intrusive_ptr() BOOST_SP_NOEXCEPT : px( 0 ) BOOST_CONSTEXPR intrusive_ptr() noexcept : px( 0 )
{ {
} }
@ -85,12 +85,12 @@ public:
// Move support // Move support
intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px ) intrusive_ptr(intrusive_ptr && rhs) noexcept : px( rhs.px )
{ {
rhs.px = 0; rhs.px = 0;
} }
intrusive_ptr & operator=(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT intrusive_ptr & operator=(intrusive_ptr && rhs) noexcept
{ {
this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
return *this; return *this;
@ -106,7 +106,7 @@ public:
} }
template<class U> template<class U>
intrusive_ptr & operator=(intrusive_ptr<U> && rhs) BOOST_SP_NOEXCEPT intrusive_ptr & operator=(intrusive_ptr<U> && rhs) noexcept
{ {
this_type( static_cast< intrusive_ptr<U> && >( rhs ) ).swap(*this); this_type( static_cast< intrusive_ptr<U> && >( rhs ) ).swap(*this);
return *this; return *this;
@ -139,12 +139,12 @@ public:
this_type( rhs, add_ref ).swap( *this ); this_type( rhs, add_ref ).swap( *this );
} }
T * get() const BOOST_SP_NOEXCEPT T * get() const noexcept
{ {
return px; return px;
} }
T * detach() BOOST_SP_NOEXCEPT T * detach() noexcept
{ {
T * ret = px; T * ret = px;
px = 0; px = 0;
@ -163,12 +163,12 @@ public:
return px; return px;
} }
explicit operator bool () const BOOST_SP_NOEXCEPT explicit operator bool () const noexcept
{ {
return px != 0; return px != 0;
} }
void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT void swap(intrusive_ptr & rhs) noexcept
{ {
T * tmp = px; T * tmp = px;
px = rhs.px; px = rhs.px;
@ -180,69 +180,69 @@ private:
T * px; T * px;
}; };
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept
{ {
return a.get() == b.get(); return a.get() == b.get();
} }
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b) noexcept
{ {
return a.get() != b.get(); return a.get() != b.get();
} }
template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, U * b) noexcept
{ {
return a.get() == b; return a.get() == b;
} }
template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, U * b) noexcept
{ {
return a.get() != b; return a.get() != b;
} }
template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator==(T * a, intrusive_ptr<U> const & b) noexcept
{ {
return a == b.get(); return a == b.get();
} }
template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b) BOOST_SP_NOEXCEPT template<class T, class U> inline bool operator!=(T * a, intrusive_ptr<U> const & b) noexcept
{ {
return a != b.get(); return a != b.get();
} }
template<class T> inline bool operator==( intrusive_ptr<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT template<class T> inline bool operator==( intrusive_ptr<T> const & p, std::nullptr_t ) noexcept
{ {
return p.get() == 0; return p.get() == 0;
} }
template<class T> inline bool operator==( std::nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT template<class T> inline bool operator==( std::nullptr_t, intrusive_ptr<T> const & p ) noexcept
{ {
return p.get() == 0; return p.get() == 0;
} }
template<class T> inline bool operator!=( intrusive_ptr<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT template<class T> inline bool operator!=( intrusive_ptr<T> const & p, std::nullptr_t ) noexcept
{ {
return p.get() != 0; return p.get() != 0;
} }
template<class T> inline bool operator!=( std::nullptr_t, intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT template<class T> inline bool operator!=( std::nullptr_t, intrusive_ptr<T> const & p ) noexcept
{ {
return p.get() != 0; return p.get() != 0;
} }
template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) BOOST_SP_NOEXCEPT template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b) noexcept
{ {
return std::less<T *>()(a.get(), b.get()); return std::less<T *>()(a.get(), b.get());
} }
template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs) BOOST_SP_NOEXCEPT template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs) noexcept
{ {
lhs.swap(rhs); lhs.swap(rhs);
} }
// mem_fn support // mem_fn support
template<class T> T * get_pointer(intrusive_ptr<T> const & p) BOOST_SP_NOEXCEPT template<class T> T * get_pointer(intrusive_ptr<T> const & p) noexcept
{ {
return p.get(); return p.get();
} }
@ -264,17 +264,17 @@ 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());
} }
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 ) noexcept
{ {
return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false ); return intrusive_ptr<T>( static_cast<T*>( p.detach() ), false );
} }
template<class T, class U> intrusive_ptr<T> const_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT template<class T, class U> intrusive_ptr<T> const_pointer_cast( intrusive_ptr<U> && p ) noexcept
{ {
return intrusive_ptr<T>( const_cast<T*>( p.detach() ), false ); return intrusive_ptr<T>( const_cast<T*>( p.detach() ), false );
} }
template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<U> && p ) BOOST_SP_NOEXCEPT template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast( intrusive_ptr<U> && p ) noexcept
{ {
T * p2 = dynamic_cast<T*>( p.get() ); T * p2 = dynamic_cast<T*>( p.get() );
@ -297,7 +297,7 @@ template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y>
template< class T > struct hash; template< class T > struct hash;
template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) BOOST_SP_NOEXCEPT template< class T > std::size_t hash_value( boost::intrusive_ptr<T> const & p ) noexcept
{ {
return boost::hash< T* >()( p.get() ); return boost::hash< T* >()( p.get() );
} }
@ -311,7 +311,7 @@ namespace std
template<class T> struct hash< ::boost::intrusive_ptr<T> > template<class T> struct hash< ::boost::intrusive_ptr<T> >
{ {
std::size_t operator()( ::boost::intrusive_ptr<T> const & p ) const BOOST_SP_NOEXCEPT std::size_t operator()( ::boost::intrusive_ptr<T> const & p ) const noexcept
{ {
return std::hash< T* >()( p.get() ); return std::hash< T* >()( p.get() );
} }