From 87a4dc144ff2884596df57c9acdb963ce593cc59 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 2 Oct 2024 21:38:23 +0300 Subject: [PATCH] Remove uses of BOOST_SP_NOEXCEPT from shared_array.hpp --- include/boost/smart_ptr/shared_array.hpp | 54 ++++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/boost/smart_ptr/shared_array.hpp b/include/boost/smart_ptr/shared_array.hpp index 24ac89b..005175b 100644 --- a/include/boost/smart_ptr/shared_array.hpp +++ b/include/boost/smart_ptr/shared_array.hpp @@ -49,11 +49,11 @@ public: typedef T element_type; - shared_array() BOOST_SP_NOEXCEPT : px( 0 ), pn() + shared_array() noexcept : px( 0 ), pn() { } - shared_array( std::nullptr_t ) BOOST_SP_NOEXCEPT : px( 0 ), pn() + shared_array( std::nullptr_t ) noexcept : px( 0 ), pn() { } @@ -84,11 +84,11 @@ public: // generated copy constructor, destructor are fine... // ... 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 ) noexcept : px( r.px ), pn( r.pn ) { } - shared_array( shared_array && r ) BOOST_SP_NOEXCEPT : px( r.px ), pn() + shared_array( shared_array && r ) noexcept : px( r.px ), pn() { pn.swap( r.pn ); r.px = 0; @@ -98,7 +98,7 @@ public: template shared_array( shared_array 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 ) + noexcept : px( r.px ), pn( r.pn ) { boost::detail::sp_assert_convertible< Y[], T[] >(); } @@ -106,39 +106,39 @@ public: // aliasing template< class Y > - shared_array( shared_array const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) + shared_array( shared_array const & r, element_type * p ) noexcept : px( p ), pn( r.pn ) { } // assignment - shared_array & operator=( shared_array const & r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array const & r ) noexcept { this_type( r ).swap( *this ); return *this; } template - shared_array & operator=( shared_array const & r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array const & r ) noexcept { this_type( r ).swap( *this ); return *this; } - shared_array & operator=( shared_array && r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array && r ) noexcept { this_type( static_cast< shared_array && >( r ) ).swap( *this ); return *this; } template - shared_array & operator=( shared_array && r ) BOOST_SP_NOEXCEPT + shared_array & operator=( shared_array && r ) noexcept { this_type( static_cast< shared_array && >( r ) ).swap( *this ); return *this; } - void reset() BOOST_SP_NOEXCEPT + void reset() noexcept { this_type().swap( *this ); } @@ -159,7 +159,7 @@ public: this_type( p, d, a ).swap( *this ); } - template void reset( shared_array const & r, element_type * p ) BOOST_SP_NOEXCEPT + template void reset( shared_array const & r, element_type * p ) noexcept { this_type( r, p ).swap( *this ); } @@ -171,33 +171,33 @@ public: return px[i]; } - T * get() const BOOST_SP_NOEXCEPT + T * get() const noexcept { return px; } - explicit operator bool () const BOOST_SP_NOEXCEPT + explicit operator bool () const noexcept { return px != 0; } - bool unique() const BOOST_SP_NOEXCEPT + bool unique() const noexcept { return pn.unique(); } - long use_count() const BOOST_SP_NOEXCEPT + long use_count() const noexcept { return pn.use_count(); } - void swap(shared_array & other) BOOST_SP_NOEXCEPT + void swap(shared_array & other) noexcept { std::swap(px, other.px); pn.swap(other.pn); } - void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT + void * _internal_get_deleter( boost::detail::sp_typeinfo_ const & ti ) const noexcept { return pn.get_deleter( ti ); } @@ -211,47 +211,47 @@ private: }; // shared_array -template inline bool operator==(shared_array const & a, shared_array const & b) BOOST_SP_NOEXCEPT +template inline bool operator==(shared_array const & a, shared_array const & b) noexcept { return a.get() == b.get(); } -template inline bool operator!=(shared_array const & a, shared_array const & b) BOOST_SP_NOEXCEPT +template inline bool operator!=(shared_array const & a, shared_array const & b) noexcept { return a.get() != b.get(); } -template inline bool operator==( shared_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator==( shared_array const & p, std::nullptr_t ) noexcept { return p.get() == 0; } -template inline bool operator==( std::nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator==( std::nullptr_t, shared_array const & p ) noexcept { return p.get() == 0; } -template inline bool operator!=( shared_array const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT +template inline bool operator!=( shared_array const & p, std::nullptr_t ) noexcept { return p.get() != 0; } -template inline bool operator!=( std::nullptr_t, shared_array const & p ) BOOST_SP_NOEXCEPT +template inline bool operator!=( std::nullptr_t, shared_array const & p ) noexcept { return p.get() != 0; } -template inline bool operator<(shared_array const & a, shared_array const & b) BOOST_SP_NOEXCEPT +template inline bool operator<(shared_array const & a, shared_array const & b) noexcept { return std::less()(a.get(), b.get()); } -template void swap(shared_array & a, shared_array & b) BOOST_SP_NOEXCEPT +template void swap(shared_array & a, shared_array & b) noexcept { a.swap(b); } -template< class D, class T > D * get_deleter( shared_array const & p ) BOOST_SP_NOEXCEPT +template< class D, class T > D * get_deleter( shared_array const & p ) noexcept { return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID_(D) ) ); }