forked from boostorg/smart_ptr
Merged revision(s) 81368, 81399, 81407-81409, 81419, 81430-81431, 81437 from trunk:
Apply BOOST_NOEXCEPT patch. Refs #7523. ........ Replace std::forward with detail::sp_forward. ........ Cosmetic changes in make_shared_array.hpp and allocate_shared_array.hpp ........ Documentation of make_shared_array: Minor corrections ........ Make make_shared_array.hpp and allocate_shared_array.hpp consistent with namespace qualification in rest of smart_ptr. ........ Update smart_ptr.htm with link to make_shared_array.htm which lists the many overloads of make_shared and allocate_shared for arrays. ........ Update documentation for make_shared and allocate_shared array forms. ........ Minor corrections in make_shared_array.html documentation. ........ Borland fixes. ........ [SVN r81457]
This commit is contained in:
1 parent
215771c83d
commit
c7b6e56b30
16 files changed
+448
-317
No files matched your search
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
typedef T element_type;
|
||||
|
||||
explicit scoped_array( T * p = 0 ) : px( p ) // never throws
|
||||
explicit scoped_array( T * p = 0 ) BOOST_NOEXCEPT : px( p )
|
||||
{
|
||||
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
|
||||
boost::sp_array_constructor_hook( px );
|
||||
@@ -68,20 +68,20 @@ public:
|
||||
boost::checked_array_delete( px );
|
||||
}
|
||||
|
||||
void reset(T * p = 0) // never throws
|
||||
void reset(T * p = 0) // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
|
||||
{
|
||||
BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
|
||||
this_type(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;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
// implicit conversion to "bool"
|
||||
#include <boost/smart_ptr/detail/operator_bool.hpp>
|
||||
|
||||
void swap(scoped_array & b) // never throws
|
||||
void swap(scoped_array & b) BOOST_NOEXCEPT
|
||||
{
|
||||
T * tmp = b.px;
|
||||
b.px = px;
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) // never throws
|
||||
template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) BOOST_NOEXCEPT
|
||||
{
|
||||
a.swap(b);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user