Remove uses of BOOST_SP_NOEXCEPT from shared_array.hpp

This commit is contained in:
Peter Dimov
2024-10-02 21:38:23 +03:00
parent e6529af03f
commit 87a4dc144f

View File

@@ -49,11 +49,11 @@ public:
typedef T element_type; 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... // generated copy constructor, destructor are fine...
// ... except in C++0x, move disables the implicit copy // ... 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 ); pn.swap( r.pn );
r.px = 0; r.px = 0;
@@ -98,7 +98,7 @@ public:
template<class Y> template<class Y>
shared_array( shared_array<Y> const & r, typename boost::detail::sp_enable_if_convertible< Y[], T[] >::type = boost::detail::sp_empty() ) shared_array( shared_array<Y> 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[] >(); boost::detail::sp_assert_convertible< Y[], T[] >();
} }
@@ -106,39 +106,39 @@ public:
// aliasing // aliasing
template< class Y > template< class Y >
shared_array( shared_array<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT : px( p ), pn( r.pn ) shared_array( shared_array<Y> const & r, element_type * p ) noexcept : px( p ), pn( r.pn )
{ {
} }
// assignment // assignment
shared_array & operator=( shared_array const & r ) BOOST_SP_NOEXCEPT shared_array & operator=( shared_array const & r ) noexcept
{ {
this_type( r ).swap( *this ); this_type( r ).swap( *this );
return *this; return *this;
} }
template<class Y> template<class Y>
shared_array & operator=( shared_array<Y> const & r ) BOOST_SP_NOEXCEPT shared_array & operator=( shared_array<Y> const & r ) noexcept
{ {
this_type( r ).swap( *this ); this_type( r ).swap( *this );
return *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 ); this_type( static_cast< shared_array && >( r ) ).swap( *this );
return *this; return *this;
} }
template<class Y> template<class Y>
shared_array & operator=( shared_array<Y> && r ) BOOST_SP_NOEXCEPT shared_array & operator=( shared_array<Y> && r ) noexcept
{ {
this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this ); this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this );
return *this; return *this;
} }
void reset() BOOST_SP_NOEXCEPT void reset() noexcept
{ {
this_type().swap( *this ); this_type().swap( *this );
} }
@@ -159,7 +159,7 @@ public:
this_type( p, d, a ).swap( *this ); this_type( p, d, a ).swap( *this );
} }
template<class Y> void reset( shared_array<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT template<class Y> void reset( shared_array<Y> const & r, element_type * p ) noexcept
{ {
this_type( r, p ).swap( *this ); this_type( r, p ).swap( *this );
} }
@@ -171,33 +171,33 @@ public:
return px[i]; return px[i];
} }
T * get() const BOOST_SP_NOEXCEPT T * get() const noexcept
{ {
return px; return px;
} }
explicit operator bool () const BOOST_SP_NOEXCEPT explicit operator bool () const noexcept
{ {
return px != 0; return px != 0;
} }
bool unique() const BOOST_SP_NOEXCEPT bool unique() const noexcept
{ {
return pn.unique(); return pn.unique();
} }
long use_count() const BOOST_SP_NOEXCEPT long use_count() const noexcept
{ {
return pn.use_count(); return pn.use_count();
} }
void swap(shared_array<T> & other) BOOST_SP_NOEXCEPT void swap(shared_array<T> & other) noexcept
{ {
std::swap(px, other.px); std::swap(px, other.px);
pn.swap(other.pn); 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 ); return pn.get_deleter( ti );
} }
@@ -211,47 +211,47 @@ private:
}; // shared_array }; // shared_array
template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) noexcept
{ {
return a.get() == b.get(); return a.get() == b.get();
} }
template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) noexcept
{ {
return a.get() != b.get(); return a.get() != b.get();
} }
template<class T> inline bool operator==( shared_array<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT template<class T> inline bool operator==( shared_array<T> const & p, std::nullptr_t ) noexcept
{ {
return p.get() == 0; return p.get() == 0;
} }
template<class T> inline bool operator==( std::nullptr_t, shared_array<T> const & p ) BOOST_SP_NOEXCEPT template<class T> inline bool operator==( std::nullptr_t, shared_array<T> const & p ) noexcept
{ {
return p.get() == 0; return p.get() == 0;
} }
template<class T> inline bool operator!=( shared_array<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT template<class T> inline bool operator!=( shared_array<T> const & p, std::nullptr_t ) noexcept
{ {
return p.get() != 0; return p.get() != 0;
} }
template<class T> inline bool operator!=( std::nullptr_t, shared_array<T> const & p ) BOOST_SP_NOEXCEPT template<class T> inline bool operator!=( std::nullptr_t, shared_array<T> const & p ) noexcept
{ {
return p.get() != 0; return p.get() != 0;
} }
template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_SP_NOEXCEPT template<class T> inline bool operator<(shared_array<T> const & a, shared_array<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(shared_array<T> & a, shared_array<T> & b) BOOST_SP_NOEXCEPT template<class T> void swap(shared_array<T> & a, shared_array<T> & b) noexcept
{ {
a.swap(b); a.swap(b);
} }
template< class D, class T > D * get_deleter( shared_array<T> const & p ) BOOST_SP_NOEXCEPT template< class D, class T > D * get_deleter( shared_array<T> const & p ) noexcept
{ {
return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID_(D) ) ); return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID_(D) ) );
} }