mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-07-30 12:47:28 +02:00
Remove uses of BOOST_SP_NOEXCEPT from intrusive_ptr.hpp
This commit is contained in:
@ -51,7 +51,7 @@ public:
|
||||
|
||||
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
|
||||
|
||||
intrusive_ptr(intrusive_ptr && rhs) BOOST_SP_NOEXCEPT : px( rhs.px )
|
||||
intrusive_ptr(intrusive_ptr && rhs) noexcept : px( rhs.px )
|
||||
{
|
||||
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);
|
||||
return *this;
|
||||
@ -106,7 +106,7 @@ public:
|
||||
}
|
||||
|
||||
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);
|
||||
return *this;
|
||||
@ -139,12 +139,12 @@ public:
|
||||
this_type( rhs, add_ref ).swap( *this );
|
||||
}
|
||||
|
||||
T * get() const BOOST_SP_NOEXCEPT
|
||||
T * get() const noexcept
|
||||
{
|
||||
return px;
|
||||
}
|
||||
|
||||
T * detach() BOOST_SP_NOEXCEPT
|
||||
T * detach() noexcept
|
||||
{
|
||||
T * ret = px;
|
||||
px = 0;
|
||||
@ -163,12 +163,12 @@ public:
|
||||
return px;
|
||||
}
|
||||
|
||||
explicit operator bool () const BOOST_SP_NOEXCEPT
|
||||
explicit operator bool () const noexcept
|
||||
{
|
||||
return px != 0;
|
||||
}
|
||||
|
||||
void swap(intrusive_ptr & rhs) BOOST_SP_NOEXCEPT
|
||||
void swap(intrusive_ptr & rhs) noexcept
|
||||
{
|
||||
T * tmp = px;
|
||||
px = rhs.px;
|
||||
@ -180,69 +180,69 @@ private:
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// 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();
|
||||
}
|
||||
@ -264,17 +264,17 @@ template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U
|
||||
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 );
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
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() );
|
||||
|
||||
@ -297,7 +297,7 @@ template<class Y> std::ostream & operator<< (std::ostream & os, intrusive_ptr<Y>
|
||||
|
||||
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() );
|
||||
}
|
||||
@ -311,7 +311,7 @@ namespace std
|
||||
|
||||
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() );
|
||||
}
|
||||
|
Reference in New Issue
Block a user