forked from boostorg/smart_ptr
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
typedef T element_type;
|
||||
|
||||
shared_array(): px( 0 ), pn() // never throws
|
||||
shared_array() BOOST_NOEXCEPT : px( 0 ), pn()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -90,11 +90,11 @@ public:
|
||||
|
||||
// ... except in C++0x, move disables the implicit copy
|
||||
|
||||
shared_array( shared_array const & r ): px( r.px ), pn( r.pn ) // never throws
|
||||
shared_array( shared_array const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
|
||||
{
|
||||
}
|
||||
|
||||
shared_array( shared_array && r ): px( r.px ), pn() // never throws
|
||||
shared_array( shared_array && r ) BOOST_NOEXCEPT : px( r.px ), pn()
|
||||
{
|
||||
pn.swap( r.pn );
|
||||
r.px = 0;
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
shared_array( shared_array<Y> const & r )
|
||||
|
||||
#endif
|
||||
: px( r.px ), pn( r.pn ) // never throws
|
||||
BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) // never throws
|
||||
{
|
||||
boost::detail::sp_assert_convertible< Y[], T[] >();
|
||||
}
|
||||
@@ -122,13 +122,13 @@ public:
|
||||
// aliasing
|
||||
|
||||
template< class Y >
|
||||
shared_array( shared_array<Y> const & r, element_type * p ): px( p ), pn( r.pn ) // never throws
|
||||
shared_array( shared_array<Y> const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn )
|
||||
{
|
||||
}
|
||||
|
||||
// assignment
|
||||
|
||||
shared_array & operator=( shared_array const & r ) // never throws
|
||||
shared_array & operator=( shared_array const & r ) BOOST_NOEXCEPT
|
||||
{
|
||||
this_type( r ).swap( *this );
|
||||
return *this;
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400)
|
||||
|
||||
template<class Y>
|
||||
shared_array & operator=( shared_array<Y> const & r ) // never throws
|
||||
shared_array & operator=( shared_array<Y> const & r ) BOOST_NOEXCEPT
|
||||
{
|
||||
this_type( r ).swap( *this );
|
||||
return *this;
|
||||
@@ -147,14 +147,14 @@ public:
|
||||
|
||||
#if defined( BOOST_HAS_RVALUE_REFS )
|
||||
|
||||
shared_array & operator=( shared_array && r ) // never throws
|
||||
shared_array & operator=( shared_array && r ) BOOST_NOEXCEPT
|
||||
{
|
||||
this_type( static_cast< shared_array && >( r ) ).swap( *this );
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<class Y>
|
||||
shared_array & operator=( shared_array<Y> && r ) // never throws
|
||||
shared_array & operator=( shared_array<Y> && r ) BOOST_NOEXCEPT
|
||||
{
|
||||
this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this );
|
||||
return *this;
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
void reset() // never throws
|
||||
void reset() BOOST_NOEXCEPT
|
||||
{
|
||||
this_type().swap( *this );
|
||||
}
|
||||
@@ -188,14 +188,14 @@ public:
|
||||
this_type( r, p ).swap( *this );
|
||||
}
|
||||
|
||||
T & operator[] (std::ptrdiff_t i) const // never throws
|
||||
T & operator[] (std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
|
||||
{
|
||||
BOOST_ASSERT(px != 0);
|
||||
BOOST_ASSERT(i >= 0);
|
||||
return px[i];
|
||||
}
|
||||
|
||||
T * get() const // never throws
|
||||
T * get() const BOOST_NOEXCEPT
|
||||
{
|
||||
return px;
|
||||
}
|
||||
@@ -203,17 +203,17 @@ public:
|
||||
// implicit conversion to "bool"
|
||||
#include <boost/smart_ptr/detail/operator_bool.hpp>
|
||||
|
||||
bool unique() const // never throws
|
||||
bool unique() const BOOST_NOEXCEPT
|
||||
{
|
||||
return pn.unique();
|
||||
}
|
||||
|
||||
long use_count() const // never throws
|
||||
long use_count() const BOOST_NOEXCEPT
|
||||
{
|
||||
return pn.use_count();
|
||||
}
|
||||
|
||||
void swap(shared_array<T> & other) // never throws
|
||||
void swap(shared_array<T> & other) BOOST_NOEXCEPT
|
||||
{
|
||||
std::swap(px, other.px);
|
||||
pn.swap(other.pn);
|
||||
@@ -233,22 +233,22 @@ private:
|
||||
|
||||
}; // shared_array
|
||||
|
||||
template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) // never throws
|
||||
template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
|
||||
{
|
||||
return a.get() == b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) // never throws
|
||||
template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
|
||||
{
|
||||
return a.get() != b.get();
|
||||
}
|
||||
|
||||
template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) // never throws
|
||||
template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
|
||||
{
|
||||
return std::less<T*>()(a.get(), b.get());
|
||||
}
|
||||
|
||||
template<class T> void swap(shared_array<T> & a, shared_array<T> & b) // never throws
|
||||
template<class T> void swap(shared_array<T> & a, shared_array<T> & b) BOOST_NOEXCEPT
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user