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:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_forward.hpp>
|
||||
#include <boost/type_traits/type_with_alignment.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <cstddef>
|
||||
@@ -67,12 +68,12 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
sp_ms_deleter(): initialized_( false )
|
||||
sp_ms_deleter() BOOST_NOEXCEPT : initialized_( false )
|
||||
{
|
||||
}
|
||||
|
||||
// optimization: do not copy storage_
|
||||
sp_ms_deleter( sp_ms_deleter const & ): initialized_( false )
|
||||
sp_ms_deleter( sp_ms_deleter const & ) BOOST_NOEXCEPT : initialized_( false )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -86,26 +87,17 @@ public:
|
||||
destroy();
|
||||
}
|
||||
|
||||
void * address()
|
||||
void * address() BOOST_NOEXCEPT
|
||||
{
|
||||
return storage_.data_;
|
||||
}
|
||||
|
||||
void set_initialized()
|
||||
void set_initialized() BOOST_NOEXCEPT
|
||||
{
|
||||
initialized_ = true;
|
||||
}
|
||||
};
|
||||
|
||||
#if defined( BOOST_HAS_RVALUE_REFS )
|
||||
|
||||
template< class T > T&& sp_forward( T & t )
|
||||
{
|
||||
return static_cast< T&& >( t );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template< class T > struct sp_if_not_array
|
||||
{
|
||||
typedef boost::shared_ptr< T > type;
|
||||
@@ -117,12 +109,16 @@ template< class T > struct sp_if_not_array< T[] >
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined( __BORLANDC__ ) || !BOOST_WORKAROUND( __BORLANDC__, < 0x600 )
|
||||
|
||||
template< class T, std::size_t N > struct sp_if_not_array< T[N] >
|
||||
{
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
|
||||
|
||||
Reference in New Issue
Block a user