Compare commits

...

27 Commits

Author SHA1 Message Date
Beman Dawes
565a79c136 Release 1.47.0
[SVN r73007]
2011-07-11 22:16:03 +00:00
Peter Dimov
8abc8889d1 Merge [69262] to release. Fixes #5018.
[SVN r70447]
2011-03-23 00:13:54 +00:00
Peter Dimov
c5b47e2136 Merge [69261] to release. Fixes #5019.
[SVN r70441]
2011-03-22 23:55:05 +00:00
Peter Dimov
7c0815c567 Merge [69260] to release. Fixes #5216.
[SVN r70440]
2011-03-22 23:51:10 +00:00
Peter Dimov
210288f02e Merge [69251] to release. Fixes #4127.
[SVN r70439]
2011-03-22 23:45:59 +00:00
Peter Dimov
cf7b6904e8 Merge [69250] to release. Fixes #4256. Fixes #3875.
[SVN r70436]
2011-03-22 23:38:12 +00:00
Peter Dimov
b978919dd1 Merge [69246] to release. Fixes #4478.
[SVN r70435]
2011-03-22 23:29:35 +00:00
Peter Dimov
1086aff971 Merge [69245] to release. Fixes #4433.
[SVN r70434]
2011-03-22 23:23:44 +00:00
Peter Dimov
445e8d1728 Merge [69244] to release. Fixes #4892.
[SVN r70433]
2011-03-22 23:17:51 +00:00
Peter Dimov
545745d649 Merge [69242] to release. Fixes #4288. Fixes #5189.
[SVN r70432]
2011-03-22 23:05:48 +00:00
Hartmut Kaiser
d71cc6ab08 Merging from trunk
[SVN r66166]
2010-10-24 22:24:54 +00:00
Peter Dimov
0d77fd0678 Merge [62248] to release. Fixes #3856.
[SVN r63827]
2010-07-10 21:17:40 +00:00
Peter Dimov
6ca6d3ce6f Merge [62246] to release. Fixes #4217.
[SVN r63826]
2010-07-10 21:07:05 +00:00
Peter Dimov
cfc82854d3 Merge [62245] to release. Fixes #4199.
[SVN r63825]
2010-07-10 20:46:53 +00:00
Peter Dimov
b9d77d877e Merge [61344] to release. Fixes #4108.
[SVN r62244]
2010-05-26 17:34:01 +00:00
Peter Dimov
1f50e3abe4 Merge [61574], [61575], [61579] to release.
[SVN r62243]
2010-05-26 17:25:06 +00:00
Peter Dimov
697f338510 Merge [61074]. Fixes #4067.
[SVN r61078]
2010-04-05 19:37:32 +00:00
Peter Dimov
f4386409d9 Merge [58275], [58306] to release.
[SVN r58380]
2009-12-14 17:44:19 +00:00
Peter Dimov
ba349679f3 Merge [58123], [58127], [58128] to release. Fixes #3666.
[SVN r58195]
2009-12-06 17:50:28 +00:00
Peter Dimov
a3b84f8586 Merge [58094] to release.
[SVN r58122]
2009-12-03 17:50:37 +00:00
Peter Dimov
b0fd8a6b08 Merge [57957] to release. Fixes #3570.
[SVN r58067]
2009-11-30 20:34:39 +00:00
Peter Dimov
4f5062004a Merge [57954], [57955] to release.
[SVN r58066]
2009-11-30 20:30:22 +00:00
Peter Dimov
f040bed751 Merge [57953] to release. Fixes #2681.
[SVN r58065]
2009-11-30 20:25:01 +00:00
Peter Dimov
2f8945a885 Merge [57951] to release. Fixes #3351.
[SVN r58064]
2009-11-30 20:20:52 +00:00
Peter Dimov
2bd0778778 Merge [57949] to release. Fixes #3678. Fixes #3341.
[SVN r58063]
2009-11-30 20:17:14 +00:00
Peter Dimov
eec640bfd7 Merge [57520] to release. Fixes #2962.
[SVN r57960]
2009-11-26 22:10:30 +00:00
Peter Dimov
754fd941ee Merge [57950], [57952] to release. Fixes #3404. Fixes #3456.
[SVN r57959]
2009-11-26 21:58:16 +00:00
29 changed files with 1006 additions and 120 deletions

View File

@@ -29,20 +29,24 @@
and <STRONG>shared_ptr&lt;T const&gt;</STRONG>, depending on constness, to <STRONG>this</STRONG>.</P>
<h3><a name="Example">Example</a></h3>
<pre>
class Y: public enable_shared_from_this&lt;Y&gt;
#include &lt;boost/enable_shared_from_this.hpp&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;cassert&gt;
class Y: public boost::enable_shared_from_this&lt;Y&gt;
{
public:
shared_ptr&lt;Y&gt; f()
boost::shared_ptr&lt;Y&gt; f()
{
return shared_from_this();
}
}
};
int main()
{
shared_ptr&lt;Y&gt; p(new Y);
shared_ptr&lt;Y&gt; q = p-&gt;f();
boost::shared_ptr&lt;Y&gt; p(new Y);
boost::shared_ptr&lt;Y&gt; q = p-&gt;f();
assert(p == q);
assert(!(p &lt; q || q &lt; p)); // p and q must share ownership
}

View File

@@ -19,20 +19,72 @@
#if defined( BOOST_NO_TYPEID )
#include <boost/current_function.hpp>
#include <functional>
namespace boost
{
namespace detail
{
typedef void* sp_typeinfo;
class sp_typeinfo
{
private:
sp_typeinfo( sp_typeinfo const& );
sp_typeinfo& operator=( sp_typeinfo const& );
char const * name_;
public:
explicit sp_typeinfo( char const * name ): name_( name )
{
}
bool operator==( sp_typeinfo const& rhs ) const
{
return this == &rhs;
}
bool operator!=( sp_typeinfo const& rhs ) const
{
return this != &rhs;
}
bool before( sp_typeinfo const& rhs ) const
{
return std::less< sp_typeinfo const* >()( this, &rhs );
}
char const* name() const
{
return name_;
}
};
template<class T> struct sp_typeid_
{
static char v_;
static sp_typeinfo ti_;
static char const * name()
{
return BOOST_CURRENT_FUNCTION;
}
};
template<class T> char sp_typeid_< T >::v_;
#if defined(__SUNPRO_CC)
// see #4199, the Sun Studio compiler gets confused about static initialization
// constructor arguments. But an assignment works just fine.
template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
#else
template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
#endif
template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
{
};
template<class T> struct sp_typeid_< T const >: sp_typeid_< T >
{
@@ -50,7 +102,7 @@ template<class T> struct sp_typeid_< T const volatile >: sp_typeid_< T >
} // namespace boost
#define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_<T>::v_)
#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_<T>::ti_)
#else

View File

@@ -11,7 +11,7 @@
//
// Defines enum boost::memory_order per the C++0x working draft
//
// Copyright (c) 2008 Peter Dimov
// Copyright (c) 2008, 2009 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
@@ -21,13 +21,31 @@
namespace boost
{
//
// Enum values are chosen so that code that needs to insert
// a trailing fence for acquire semantics can use a single
// test such as:
//
// if( mo & memory_order_acquire ) { ...fence... }
//
// For leading fences one can use:
//
// if( mo & memory_order_release ) { ...fence... }
//
// Architectures such as Alpha that need a fence on consume
// can use:
//
// if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... }
//
enum memory_order
{
memory_order_relaxed = 0,
memory_order_acquire = 1,
memory_order_release = 2,
memory_order_acq_rel = 3, // acquire | release
memory_order_seq_cst = 7 // acq_rel | 4
memory_order_seq_cst = 7, // acq_rel | 4
memory_order_consume = 8
};
} // namespace boost

View File

@@ -1,3 +1,6 @@
#ifndef BOOST_SMART_PTR_HPP_INCLUDED
#define BOOST_SMART_PTR_HPP_INCLUDED
//
// smart_ptr.hpp
//
@@ -22,4 +25,7 @@
# include <boost/weak_ptr.hpp>
# include <boost/intrusive_ptr.hpp>
# include <boost/enable_shared_from_this.hpp>
# include <boost/make_shared.hpp>
#endif
#endif // #ifndef BOOST_SMART_PTR_HPP_INCLUDED

View File

@@ -17,6 +17,7 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/assert.hpp>
#include <pthread.h>
namespace boost
@@ -42,15 +43,15 @@ public:
// HPUX 10.20 / DCE has a nonstandard pthread_mutex_init
#if defined(__hpux) && defined(_DECTHREADS_)
pthread_mutex_init(&m_, pthread_mutexattr_default);
BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 );
#else
pthread_mutex_init(&m_, 0);
BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 );
#endif
}
~lightweight_mutex()
{
pthread_mutex_destroy(&m_);
BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 );
}
class scoped_lock;
@@ -69,12 +70,12 @@ public:
scoped_lock(lightweight_mutex & m): m_(m.m_)
{
pthread_mutex_lock(&m_);
BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 );
}
~scoped_lock()
{
pthread_mutex_unlock(&m_);
BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 );
}
};
};

View File

@@ -74,8 +74,9 @@ template<unsigned size, unsigned align_> struct allocator_impl
static lightweight_mutex & mutex()
{
static lightweight_mutex m;
return m;
static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm;
static lightweight_mutex * pm = new( &fbm ) lightweight_mutex;
return *pm;
}
static lightweight_mutex * mutex_init;

View File

@@ -52,6 +52,10 @@ int const weak_count_id = 0x298C38A4;
struct sp_nothrow_tag {};
template< class D > struct sp_inplace_tag
{
};
class weak_count;
class shared_count
@@ -142,6 +146,40 @@ public:
#endif
}
#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
template< class P, class D > shared_count( P p, sp_inplace_tag<D> ): pi_( 0 )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
{
#ifndef BOOST_NO_EXCEPTIONS
try
{
pi_ = new sp_counted_impl_pd< P, D >( p );
}
catch( ... )
{
D()( p ); // delete p
throw;
}
#else
pi_ = new sp_counted_impl_pd< P, D >( p );
if( pi_ == 0 )
{
D()( p ); // delete p
boost::throw_exception( std::bad_alloc() );
}
#endif // #ifndef BOOST_NO_EXCEPTIONS
}
#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
@@ -188,6 +226,56 @@ public:
#endif
}
#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
template< class P, class D, class A > shared_count( P p, sp_inplace_tag< D >, A a ): pi_( 0 )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
{
typedef sp_counted_impl_pda< P, D, A > impl_type;
typedef typename A::template rebind< impl_type >::other A2;
A2 a2( a );
#ifndef BOOST_NO_EXCEPTIONS
try
{
pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
new( static_cast< void* >( pi_ ) ) impl_type( p, a );
}
catch(...)
{
D()( p );
if( pi_ != 0 )
{
a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
}
throw;
}
#else
pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
if( pi_ != 0 )
{
new( static_cast< void* >( pi_ ) ) impl_type( p, a );
}
else
{
D()( p );
boost::throw_exception( std::bad_alloc() );
}
#endif // #ifndef BOOST_NO_EXCEPTIONS
}
#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
#ifndef BOOST_NO_AUTO_PTR
// auto_ptr<Y> is special cased to provide the strong guarantee

View File

@@ -25,7 +25,7 @@
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x610 )
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x630 )
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif
@@ -45,7 +45,7 @@ template< class Y, class T > struct sp_convertible
static yes f( T* );
static no f( ... );
enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };
enum _vt { value = sizeof( (f)( static_cast<Y*>(0) ) ) == sizeof(yes) };
};
struct sp_empty

View File

@@ -30,9 +30,9 @@ namespace detail
inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ )
{
__asm__ __volatile__( "cas %0, %2, %1"
: "+m" (*dest_), "+r" (swap_)
: "r" (compare_)
__asm__ __volatile__( "cas [%1], %2, %0"
: "+r" (swap_)
: "r" (dest_), "r" (compare_)
: "memory" );
return swap_;

View File

@@ -135,7 +135,11 @@ public:
// pre: d(p) must not throw
sp_counted_impl_pd( P p, D d ): ptr(p), del(d)
sp_counted_impl_pd( P p, D & d ): ptr( p ), del( d )
{
}
sp_counted_impl_pd( P p ): ptr( p ), del()
{
}
@@ -195,7 +199,11 @@ public:
// pre: d( p ) must not throw
sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a )
sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( d ), a_( a )
{
}
sp_counted_impl_pda( P p, A a ): p_( p ), d_(), a_( a )
{
}

View File

@@ -20,7 +20,7 @@
// are available.
//
#if defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
#if defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( BOOST_SP_NO_SYNC )
#define BOOST_SP_HAS_SYNC
@@ -40,7 +40,7 @@
#undef BOOST_SP_HAS_SYNC
#endif
#if defined( __INTEL_COMPILER ) && !defined( __ia64__ )
#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1100 )
#undef BOOST_SP_HAS_SYNC
#endif

View File

@@ -31,7 +31,10 @@
#include <boost/config.hpp>
#include <boost/smart_ptr/detail/sp_has_sync.hpp>
#if defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
#if defined( BOOST_SP_USE_PTHREADS )
# include <boost/smart_ptr/detail/spinlock_pt.hpp>
#elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
# include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
#elif defined( BOOST_SP_HAS_SYNC )

View File

@@ -41,7 +41,11 @@ public:
static spinlock & spinlock_for( void const * pv )
{
#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
std::size_t i = reinterpret_cast< unsigned long long >( pv ) % 41;
#else
std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41;
#endif
return pool_[ i ];
}

View File

@@ -55,7 +55,7 @@ namespace detail
{
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" void __stdcall Sleep( unsigned ms );
extern "C" void __stdcall Sleep( unsigned long ms );
#endif
inline void yield( unsigned k )

View File

@@ -15,11 +15,6 @@
#include <boost/config.hpp>
#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash
# pragma warning(push)
# pragma warning(disable:4284) // odd return type for operator->
#endif
#include <boost/assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/smart_ptr/detail/sp_convertible.hpp>
@@ -77,7 +72,7 @@ public:
template<class U>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
intrusive_ptr( intrusive_ptr<U> const & rhs, typename detail::sp_enable_if_convertible<U,T>::type = detail::sp_empty() )
intrusive_ptr( intrusive_ptr<U> const & rhs, typename boost::detail::sp_enable_if_convertible<U,T>::type = boost::detail::sp_empty() )
#else
@@ -122,7 +117,7 @@ public:
intrusive_ptr & operator=(intrusive_ptr && rhs)
{
this_type(std::move(rhs)).swap(*this);
this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this);
return *this;
}
@@ -292,8 +287,4 @@ template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED

View File

@@ -49,7 +49,18 @@ private:
{
if( initialized_ )
{
#if defined( __GNUC__ )
// fixes incorrect aliasing warning
T * p = reinterpret_cast< T* >( storage_.data_ );
p->~T();
#else
reinterpret_cast< T* >( storage_.data_ )->~T();
#endif
initialized_ = false;
}
}
@@ -86,22 +97,32 @@ public:
}
};
template< class T > T forward( T t )
#if defined( BOOST_HAS_RVALUE_REFS )
template< class T > T&& sp_forward( T & t )
{
return t;
return static_cast< T&& >( t );
}
#endif
} // namespace detail
#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
# define BOOST_SP_MSD( T ) boost::detail::sp_inplace_tag< boost::detail::sp_ms_deleter< T > >()
#else
# define BOOST_SP_MSD( T ) boost::detail::sp_ms_deleter< T >()
#endif
// Zero-argument versions
//
// Used even when variadic templates are available because of the new T() vs new T issue
template< class T > boost::shared_ptr< T > make_shared()
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -116,9 +137,9 @@ template< class T > boost::shared_ptr< T > make_shared()
template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -135,15 +156,15 @@ template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a
// Variadic templates, rvalue reference
template< class T, class... Args > boost::shared_ptr< T > make_shared( Args && ... args )
template< class T, class Arg1, class... Args > boost::shared_ptr< T > make_shared( Arg1 && arg1, Args && ... args )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T( detail::forward<Args>( args )... );
::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ), boost::detail::sp_forward<Args>( args )... );
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
@@ -152,15 +173,469 @@ template< class T, class... Args > boost::shared_ptr< T > make_shared( Args && .
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class... Args > boost::shared_ptr< T > allocate_shared( A const & a, Args && ... args )
template< class T, class A, class Arg1, class... Args > boost::shared_ptr< T > allocate_shared( A const & a, Arg1 && arg1, Args && ... args )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T( detail::forward<Args>( args )... );
::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ), boost::detail::sp_forward<Args>( args )... );
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
#elif defined( BOOST_HAS_RVALUE_REFS )
// For example MSVC 10.0
template< class T, class A1 >
boost::shared_ptr< T > make_shared( A1 && a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 ),
boost::detail::sp_forward<A8>( a8 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 ),
boost::detail::sp_forward<A8>( a8 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 ),
boost::detail::sp_forward<A8>( a8 ),
boost::detail::sp_forward<A9>( a9 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T(
boost::detail::sp_forward<A1>( a1 ),
boost::detail::sp_forward<A2>( a2 ),
boost::detail::sp_forward<A3>( a3 ),
boost::detail::sp_forward<A4>( a4 ),
boost::detail::sp_forward<A5>( a5 ),
boost::detail::sp_forward<A6>( a6 ),
boost::detail::sp_forward<A7>( a7 ),
boost::detail::sp_forward<A8>( a8 ),
boost::detail::sp_forward<A9>( a9 )
);
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
@@ -176,9 +651,9 @@ template< class T, class A, class... Args > boost::shared_ptr< T > allocate_shar
template< class T, class A1 >
boost::shared_ptr< T > make_shared( A1 const & a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -194,9 +669,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1 )
template< class T, class A, class A1 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -212,9 +687,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
template< class T, class A1, class A2 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -230,9 +705,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
template< class T, class A, class A1, class A2 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -248,9 +723,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -266,9 +741,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3
template< class T, class A, class A1, class A2, class A3 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -284,9 +759,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -302,9 +777,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -320,9 +795,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -338,9 +813,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -356,9 +831,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -374,9 +849,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -392,9 +867,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -410,9 +885,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -428,9 +903,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -446,9 +921,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -464,9 +939,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -482,9 +957,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@@ -499,6 +974,8 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
#endif
#undef BOOST_SP_MSD
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED

View File

@@ -41,6 +41,7 @@
#include <algorithm> // for std::swap
#include <functional> // for std::less
#include <typeinfo> // for std::bad_cast
#include <cstddef> // for std::size_t
#if !defined(BOOST_NO_IOSTREAM)
#if !defined(BOOST_NO_IOSFWD)
@@ -50,11 +51,6 @@
#endif
#endif
#ifdef BOOST_MSVC // moved here to work around VC++ compiler crash
# pragma warning(push)
# pragma warning(disable:4284) // odd return type for operator->
#endif
namespace boost
{
@@ -228,7 +224,7 @@ public:
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
shared_ptr( shared_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
shared_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
#else
@@ -353,7 +349,7 @@ public:
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
shared_ptr( shared_ptr<Y> && r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
shared_ptr( shared_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
#else
@@ -368,14 +364,14 @@ public:
shared_ptr & operator=( shared_ptr && r ) // never throws
{
this_type( std::move( r ) ).swap( *this );
this_type( static_cast< shared_ptr && >( r ) ).swap( *this );
return *this;
}
template<class Y>
shared_ptr & operator=( shared_ptr<Y> && r ) // never throws
{
this_type( std::move( r ) ).swap( *this );
this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this );
return *this;
}
@@ -448,7 +444,7 @@ public:
return pn < rhs.pn;
}
void * _internal_get_deleter( detail::sp_typeinfo const & ti ) const
void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const
{
return pn.get_deleter( ti );
}
@@ -688,14 +684,19 @@ template<class T> inline bool atomic_compare_exchange_explicit( shared_ptr<T> *
return atomic_compare_exchange( p, v, w ); // std::move( w )
}
#endif
#endif // !defined(BOOST_SP_NO_ATOMIC_ACCESS)
// hash_value
template< class T > struct hash;
template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p )
{
return boost::hash< T* >()( p.get() );
}
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
#endif // #ifndef BOOST_SMART_PTR_SHARED_PTR_HPP_INCLUDED

View File

@@ -63,7 +63,7 @@ public:
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
weak_ptr( weak_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
weak_ptr( weak_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
#else
@@ -79,20 +79,20 @@ public:
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
weak_ptr( weak_ptr<Y> && r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
weak_ptr( weak_ptr<Y> && r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
#else
weak_ptr( weak_ptr<Y> && r )
#endif
: px(r.lock().get()), pn(std::move(r.pn)) // never throws
: px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws
{
r.px = 0;
}
// for better efficiency in the T == Y case
weak_ptr( weak_ptr && r ): px( r.px ), pn(std::move(r.pn)) // never throws
weak_ptr( weak_ptr && r ): px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws
{
r.px = 0;
}
@@ -100,7 +100,7 @@ public:
// for better efficiency in the T == Y case
weak_ptr & operator=( weak_ptr && r ) // never throws
{
this_type( std::move( r ) ).swap( *this );
this_type( static_cast< weak_ptr && >( r ) ).swap( *this );
return *this;
}
@@ -110,7 +110,7 @@ public:
template<class Y>
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
weak_ptr( shared_ptr<Y> const & r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )
weak_ptr( shared_ptr<Y> const & r, typename boost::detail::sp_enable_if_convertible<Y,T>::type = boost::detail::sp_empty() )
#else
@@ -134,9 +134,9 @@ public:
#if defined( BOOST_HAS_RVALUE_REFS )
template<class Y>
weak_ptr & operator=(weak_ptr<Y> && r)
weak_ptr & operator=( weak_ptr<Y> && r )
{
this_type( std::move( r ) ).swap( *this );
this_type( static_cast< weak_ptr<Y> && >( r ) ).swap( *this );
return *this;
}

View File

@@ -45,6 +45,7 @@ import testing ;
[ run spinlock_try_test.cpp : : : <threading>multi : spinlock_try_test.mt ]
[ run spinlock_pool_test.cpp ]
[ run make_shared_test.cpp ]
[ run make_shared_perfect_forwarding_test.cpp ]
[ run sp_convertible_test.cpp ]
[ run wp_convertible_test.cpp ]
[ run ip_convertible_test.cpp ]
@@ -61,5 +62,8 @@ import testing ;
[ run esft_constructor_test.cpp ]
[ compile-fail auto_ptr_lv_fail.cpp ]
[ run atomic_count_test2.cpp ]
[ run sp_typeinfo_test.cpp ]
[ compile make_shared_fp_test.cpp ]
[ run sp_hash_test.cpp ]
;
}

View File

@@ -0,0 +1,19 @@
//
// make_shared_fp_test.cpp
//
// Copyright 2010 Georg Fritzsche
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
int main()
{
typedef boost::shared_ptr<int>(*FP)();
FP fp = boost::make_shared<int>;
}

View File

@@ -0,0 +1,98 @@
// make_shared_perfect_forwarding_test.cpp - a test of make_shared
// perfect forwarding of constructor arguments when using a C++0x
// compiler.
//
// Copyright 2009 Frank Mori Hess
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/detail/lightweight_test.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#if !defined( BOOST_HAS_RVALUE_REFS )
int main()
{
return 0;
}
#else // BOOST_HAS_RVALUE_REFS
class myarg
{
public:
myarg()
{}
private:
myarg(myarg && other)
{}
myarg& operator=(myarg && other)
{
return *this;
}
myarg(const myarg & other)
{}
myarg& operator=(const myarg & other)
{
return *this;
}
};
class X
{
public:
enum constructor_id
{
move_constructor,
const_ref_constructor,
ref_constructor
};
X(myarg &&arg): constructed_by_(move_constructor)
{}
X(const myarg &arg): constructed_by_(const_ref_constructor)
{}
X(myarg &arg): constructed_by_(ref_constructor)
{}
constructor_id constructed_by_;
};
struct Y
{
Y(int &value): ref(value)
{}
int &ref;
};
int main()
{
{
myarg a;
boost::shared_ptr< X > x = boost::make_shared< X >(a);
BOOST_TEST( x->constructed_by_ == X::ref_constructor);
}
{
const myarg ca;
boost::shared_ptr< X > x = boost::make_shared< X >(ca);
BOOST_TEST( x->constructed_by_ == X::const_ref_constructor);
}
{
boost::shared_ptr< X > x = boost::make_shared< X >(myarg());
BOOST_TEST( x->constructed_by_ == X::move_constructor);
}
{
int value = 1;
boost::shared_ptr< Y > y = boost::make_shared< Y >(value);
BOOST_TEST( y->ref == 1 && value == y->ref );
++y->ref;
BOOST_TEST( value == y->ref );
}
return boost::report_errors();
}
#endif // BOOST_HAS_RVALUE_REFS

View File

@@ -9,6 +9,8 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/config.hpp>
#include <boost/pointer_cast.hpp>
#include <boost/shared_ptr.hpp>
@@ -58,6 +60,8 @@ class derived_derived
// And now some simple check functions
#if !defined( BOOST_NO_RTTI )
template <class BasePtr>
bool check_dynamic_pointer_cast(const BasePtr &ptr)
{
@@ -74,6 +78,8 @@ bool check_dynamic_pointer_cast(const BasePtr &ptr)
dynamic_cast<derived_derived*>(boost::get_pointer(ptr));
}
#endif
template <class BasePtr>
bool check_static_pointer_cast(const BasePtr &ptr)
{
@@ -107,7 +113,9 @@ int main()
boost::shared_ptr<base> ptr(new derived);
#if !defined( BOOST_NO_RTTI )
BOOST_TEST( check_dynamic_pointer_cast( ptr ) );
#endif
BOOST_TEST( check_static_pointer_cast( ptr ) );
BOOST_TEST( check_const_pointer_cast( ptr ) );
}
@@ -117,7 +125,9 @@ int main()
boost::scoped_ptr<base> ptr(new derived);
#if !defined( BOOST_NO_RTTI )
BOOST_TEST( check_dynamic_pointer_cast( ptr.get() ) );
#endif
BOOST_TEST( check_static_pointer_cast( ptr.get() ) );
BOOST_TEST( check_const_pointer_cast( ptr.get() ) );
}

View File

@@ -63,10 +63,12 @@ void test()
px->f();
#if !defined( BOOST_NO_RTTI )
boost::shared_ptr<Y> py2 = boost::dynamic_pointer_cast<Y>(px);
BOOST_TEST(py.get() == py2.get());
BOOST_TEST(!(py < py2 || py2 < py));
BOOST_TEST(py.use_count() == 3);
#endif
}
catch( boost::bad_weak_ptr const& )
{

View File

@@ -188,6 +188,7 @@ int main()
test_eq(p, q);
}
#if !defined( BOOST_NO_RTTI )
shared_ptr<Y> p3 = dynamic_pointer_cast<Y>(p);
shared_ptr<Y> p4 = dynamic_pointer_cast<Y>(p2);
@@ -201,6 +202,7 @@ int main()
test_is_Y(p3);
test_eq2(p, p3);
test_ne2(p2, p4);
#endif
shared_ptr<void> p5(p);
@@ -214,13 +216,17 @@ int main()
p.reset();
p2.reset();
#if !defined( BOOST_NO_RTTI )
p3.reset();
p4.reset();
#endif
test_is_zero(p);
test_is_zero(p2);
#if !defined( BOOST_NO_RTTI )
test_is_zero(p3);
test_is_zero(p4);
#endif
BOOST_TEST(p5.use_count() == 1);
@@ -250,6 +256,7 @@ int main()
test_is_nonzero(wp2.lock());
}
#if !defined( BOOST_NO_RTTI )
weak_ptr<Y> wp3 = dynamic_pointer_cast<Y>(wp2.lock());
BOOST_TEST(wp3.use_count() == 1);
@@ -259,12 +266,15 @@ int main()
BOOST_TEST(wp4.use_count() == 1);
test_shared(wp2, wp4);
#endif
wp1 = p2;
test_is_zero(wp1.lock());
#if !defined( BOOST_NO_RTTI )
wp1 = p4;
wp1 = wp3;
#endif
wp1 = wp2;
BOOST_TEST(wp1.use_count() == 1);
@@ -279,7 +289,9 @@ int main()
BOOST_TEST(wp1.use_count() == 0);
BOOST_TEST(wp2.use_count() == 0);
#if !defined( BOOST_NO_RTTI )
BOOST_TEST(wp3.use_count() == 0);
#endif
// Test operator< stability for std::set< weak_ptr<> >
// Thanks to Joe Gottman for pointing this out

View File

@@ -2462,6 +2462,8 @@ void test()
} // namespace n_const_cast
#if !defined( BOOST_NO_RTTI )
namespace n_dynamic_cast
{
@@ -2527,6 +2529,8 @@ void test()
} // namespace n_dynamic_cast
#endif
namespace n_map
{
@@ -3200,10 +3204,12 @@ void test()
BOOST_TEST(px.get() != 0);
BOOST_TEST(py.use_count() == 2);
#if !defined( BOOST_NO_RTTI )
boost::shared_ptr<Y> py2 = boost::dynamic_pointer_cast<Y>(px);
BOOST_TEST(py.get() == py2.get());
BOOST_TEST(!(py < py2 || py2 < py));
BOOST_TEST(py.use_count() == 3);
#endif
}
} // namespace n_spt_shared_from_this
@@ -3229,7 +3235,9 @@ int main()
n_comparison::test();
n_static_cast::test();
n_const_cast::test();
#if !defined( BOOST_NO_RTTI )
n_dynamic_cast::test();
#endif
n_map::test();

View File

@@ -33,10 +33,7 @@
# pragma warn -8092 // template argument passed to 'find' is not an iterator
#endif
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/detail/lightweight_test.hpp>

34
test/sp_hash_test.cpp Normal file
View File

@@ -0,0 +1,34 @@
//
// sp_hash_test.cpp
//
// Copyright 2011 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/shared_ptr.hpp>
#include <boost/functional/hash.hpp>
#include <boost/detail/lightweight_test.hpp>
int main()
{
boost::hash< boost::shared_ptr<int> > hasher;
boost::shared_ptr< int > p1, p2( p1 ), p3( new int ), p4( p3 ), p5( new int );
BOOST_TEST_EQ( p1, p2 );
BOOST_TEST_EQ( hasher( p1 ), hasher( p2 ) );
BOOST_TEST_NE( p1, p3 );
BOOST_TEST_NE( hasher( p1 ), hasher( p3 ) );
BOOST_TEST_EQ( p3, p4 );
BOOST_TEST_EQ( hasher( p3 ), hasher( p4 ) );
BOOST_TEST_NE( p3, p5 );
BOOST_TEST_NE( hasher( p3 ), hasher( p5 ) );
return boost::report_errors();
}

51
test/sp_typeinfo_test.cpp Normal file
View File

@@ -0,0 +1,51 @@
//
// sp_typeinfo_test.cpp
//
// Copyright (c) 2009 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/detail/sp_typeinfo.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
int main()
{
BOOST_TEST( BOOST_SP_TYPEID( int ) == BOOST_SP_TYPEID( int ) );
BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( long ) );
BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( void ) );
boost::detail::sp_typeinfo const & ti = BOOST_SP_TYPEID( int );
boost::detail::sp_typeinfo const * pti = &BOOST_SP_TYPEID( int );
BOOST_TEST( *pti == ti );
BOOST_TEST( ti == ti );
BOOST_TEST( !( ti != ti ) );
BOOST_TEST( !ti.before( ti ) );
char const * nti = ti.name();
std::cout << nti << std::endl;
boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void );
boost::detail::sp_typeinfo const * ptv = &BOOST_SP_TYPEID( void );
BOOST_TEST( *ptv == tv );
BOOST_TEST( tv == tv );
BOOST_TEST( !( tv != tv ) );
BOOST_TEST( !tv.before( tv ) );
char const * ntv = tv.name();
std::cout << ntv << std::endl;
BOOST_TEST( ti != tv );
BOOST_TEST( !( ti == tv ) );
BOOST_TEST( ti.before( tv ) != tv.before( ti ) );
return boost::report_errors();
}

View File

@@ -914,7 +914,6 @@ void test()
BOOST_TEST(wp2.use_count() == 0);
BOOST_TEST(!(wp < wp3 || wp3 < wp));
using std::swap;
swap(wp, wp2);
BOOST_TEST(wp.use_count() == 0);
@@ -950,7 +949,6 @@ void test()
BOOST_TEST(wp2.use_count() == 0);
BOOST_TEST(!(wp < wp3 || wp3 < wp));
using std::swap;
swap(wp, wp2);
BOOST_TEST(wp.use_count() == 0);
@@ -965,7 +963,6 @@ void test()
BOOST_TEST(wp2.use_count() == 0);
BOOST_TEST(!(wp < wp3 || wp3 < wp));
using std::swap;
swap(wp, wp2);
BOOST_TEST(wp.use_count() == 0);