diff --git a/include/boost/smart_ptr/intrusive_ptr.hpp b/include/boost/smart_ptr/intrusive_ptr.hpp index 278b8ea..2501424 100644 --- a/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/include/boost/smart_ptr/intrusive_ptr.hpp @@ -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 - 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; @@ -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 inline bool operator==(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template inline bool operator==(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return a.get() == b.get(); } -template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template inline bool operator!=(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return a.get() != b.get(); } -template inline bool operator==(intrusive_ptr const & a, U * b) BOOST_SP_NOEXCEPT +template inline bool operator==(intrusive_ptr const & a, U * b) noexcept { return a.get() == b; } -template inline bool operator!=(intrusive_ptr const & a, U * b) BOOST_SP_NOEXCEPT +template inline bool operator!=(intrusive_ptr const & a, U * b) noexcept { return a.get() != b; } -template inline bool operator==(T * a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template inline bool operator==(T * a, intrusive_ptr const & b) noexcept { return a == b.get(); } -template inline bool operator!=(T * a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template inline bool operator!=(T * a, intrusive_ptr const & b) noexcept { return a != b.get(); } -template inline bool operator==( intrusive_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( intrusive_ptr const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template inline bool operator==( std::nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, intrusive_ptr const & p ) noexcept { return p.get() == 0; } -template inline bool operator!=( intrusive_ptr const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( intrusive_ptr const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template inline bool operator!=( std::nullptr_t, intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, intrusive_ptr const & p ) noexcept { return p.get() != 0; } -template inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) BOOST_SP_NOEXCEPT +template inline bool operator<(intrusive_ptr const & a, intrusive_ptr const & b) noexcept { return std::less()(a.get(), b.get()); } -template void swap(intrusive_ptr & lhs, intrusive_ptr & rhs) BOOST_SP_NOEXCEPT +template void swap(intrusive_ptr & lhs, intrusive_ptr & rhs) noexcept { lhs.swap(rhs); } // mem_fn support -template T * get_pointer(intrusive_ptr const & p) BOOST_SP_NOEXCEPT +template T * get_pointer(intrusive_ptr const & p) noexcept { return p.get(); } @@ -264,17 +264,17 @@ template intrusive_ptr dynamic_pointer_cast(intrusive_ptr(p.get()); } -template intrusive_ptr static_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template intrusive_ptr static_pointer_cast( intrusive_ptr && p ) noexcept { return intrusive_ptr( static_cast( p.detach() ), false ); } -template intrusive_ptr const_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template intrusive_ptr const_pointer_cast( intrusive_ptr && p ) noexcept { return intrusive_ptr( const_cast( p.detach() ), false ); } -template intrusive_ptr dynamic_pointer_cast( intrusive_ptr && p ) BOOST_SP_NOEXCEPT +template intrusive_ptr dynamic_pointer_cast( intrusive_ptr && p ) noexcept { T * p2 = dynamic_cast( p.get() ); @@ -297,7 +297,7 @@ template std::ostream & operator<< (std::ostream & os, intrusive_ptr template< class T > struct hash; -template< class T > std::size_t hash_value( boost::intrusive_ptr const & p ) BOOST_SP_NOEXCEPT +template< class T > std::size_t hash_value( boost::intrusive_ptr const & p ) noexcept { return boost::hash< T* >()( p.get() ); } @@ -311,7 +311,7 @@ namespace std template struct hash< ::boost::intrusive_ptr > { - std::size_t operator()( ::boost::intrusive_ptr const & p ) const BOOST_SP_NOEXCEPT + std::size_t operator()( ::boost::intrusive_ptr const & p ) const noexcept { return std::hash< T* >()( p.get() ); }