Skip to content

Commit

Permalink
Remove uses of BOOST_SP_NOEXCEPT from shared_array.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent c396b91 commit fd7f78b
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions include/boost/smart_ptr/shared_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ template<class T> class shared_array

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()
{
}

Expand Down Expand Up @@ -84,11 +84,11 @@ template<class T> class shared_array
// 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;
Expand All @@ -98,47 +98,47 @@ template<class T> class shared_array

template<class Y>
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[] >();
}

// aliasing

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

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<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 );
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<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 );
return *this;
}

void reset() BOOST_SP_NOEXCEPT
void reset() noexcept
{
this_type().swap( *this );
}
Expand All @@ -159,7 +159,7 @@ template<class T> class shared_array
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 );
}
Expand All @@ -171,33 +171,33 @@ template<class T> class shared_array
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<T> & other) BOOST_SP_NOEXCEPT
void swap(shared_array<T> & 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 );
}
Expand All @@ -211,47 +211,47 @@ template<class T> class 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();
}

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();
}

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;
}

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;
}

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;
}

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;
}

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());
}

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);
}

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) ) );
}
Expand Down

0 comments on commit fd7f78b

Please sign in to comment.