forked from boostorg/smart_ptr
[SVN r51581]
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
//
|
||||
// enable_shared_from_this.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov
|
||||
// Copyright 2002, 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)
|
||||
// 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
|
||||
//
|
||||
// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
|
||||
//
|
||||
@@ -46,26 +46,32 @@ public:
|
||||
|
||||
shared_ptr<T> shared_from_this()
|
||||
{
|
||||
shared_ptr<T> p(_internal_weak_this);
|
||||
BOOST_ASSERT(p.get() == this);
|
||||
shared_ptr<T> p( weak_this_ );
|
||||
BOOST_ASSERT( p.get() == this );
|
||||
return p;
|
||||
}
|
||||
|
||||
shared_ptr<T const> shared_from_this() const
|
||||
{
|
||||
shared_ptr<T const> p(_internal_weak_this);
|
||||
BOOST_ASSERT(p.get() == this);
|
||||
shared_ptr<T const> p( weak_this_ );
|
||||
BOOST_ASSERT( p.get() == this );
|
||||
return p;
|
||||
}
|
||||
|
||||
// Note: No, you don't need to initialize _internal_weak_this
|
||||
//
|
||||
// Please read the documentation, not the code
|
||||
//
|
||||
// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
|
||||
public: // actually private, but avoids compiler template friendship issues
|
||||
|
||||
typedef T _internal_element_type; // for bcc 5.5.1
|
||||
mutable weak_ptr<_internal_element_type> _internal_weak_this;
|
||||
// Note: invoked automatically by shared_ptr; do not call
|
||||
template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const
|
||||
{
|
||||
if( weak_this_.expired() )
|
||||
{
|
||||
weak_this_ = shared_ptr<T>( *ppx, py );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
mutable weak_ptr<T> weak_this_;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
@@ -105,10 +105,13 @@ template< class T > boost::shared_ptr< T > make_shared()
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T();
|
||||
::new( pv ) T();
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 > boost::shared_ptr< T > allocate_shared( A const & a )
|
||||
@@ -119,10 +122,13 @@ template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T();
|
||||
::new( pv ) T();
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
T * pt2 = static_cast< T* >( pv );
|
||||
|
||||
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
|
||||
return boost::shared_ptr< T >( pt, pt2 );
|
||||
}
|
||||
|
||||
#if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
|
||||
@@ -137,10 +143,13 @@ template< class T, class... Args > boost::shared_ptr< T > make_shared( Args && .
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( detail::forward<Args>( args )... );
|
||||
::new( pv ) T( detail::forward<Args>( args )... );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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... Args > boost::shared_ptr< T > allocate_shared( A const & a, Args && ... args )
|
||||
@@ -151,10 +160,13 @@ template< class T, class A, class... Args > boost::shared_ptr< T > allocate_shar
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( detail::forward<Args>( args )... );
|
||||
::new( pv ) T( detail::forward<Args>( args )... );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
T * pt2 = static_cast< T* >( pv );
|
||||
|
||||
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
|
||||
return boost::shared_ptr< T >( pt, pt2 );
|
||||
}
|
||||
|
||||
#else
|
||||
@@ -170,10 +182,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1 )
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1 );
|
||||
::new( pv ) T( a1 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -185,10 +200,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1 );
|
||||
::new( pv ) T( a1 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -200,10 +218,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2 );
|
||||
::new( pv ) T( a1, a2 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -215,10 +236,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2 );
|
||||
::new( pv ) T( a1, a2 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -230,10 +254,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3 );
|
||||
::new( pv ) T( a1, a2, a3 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -245,10 +272,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3 );
|
||||
::new( pv ) T( a1, a2, a3 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -260,10 +290,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4 );
|
||||
::new( pv ) T( a1, a2, a3, a4 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -275,10 +308,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4 );
|
||||
::new( pv ) T( a1, a2, a3, a4 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -290,10 +326,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -305,10 +344,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -320,10 +362,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -335,10 +380,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -350,10 +398,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -365,10 +416,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -380,10 +434,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -395,10 +452,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -410,10 +470,13 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
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 >
|
||||
@@ -425,10 +488,13 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
|
||||
|
||||
void * pv = pd->address();
|
||||
|
||||
new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
::new( pv ) T( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
pd->set_initialized();
|
||||
|
||||
return boost::shared_ptr< T >( pt, static_cast< T* >( pv ) );
|
||||
T * pt2 = static_cast< T* >( pv );
|
||||
|
||||
boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
|
||||
return boost::shared_ptr< T >( pt, pt2 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T> class shared_ptr;
|
||||
template<class T> class weak_ptr;
|
||||
template<class T> class enable_shared_from_this;
|
||||
|
||||
@@ -100,9 +101,12 @@ template<> struct shared_ptr_traits<void const volatile>
|
||||
|
||||
// enable_shared_from_this support
|
||||
|
||||
template<class T, class Y> void sp_enable_shared_from_this( shared_count const & pn, boost::enable_shared_from_this<T> const * pe, Y const * px )
|
||||
template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> const * ppx, Y const * py, boost::enable_shared_from_this< T > const * pe )
|
||||
{
|
||||
if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast<Y*>(px), pn);
|
||||
if( pe != 0 )
|
||||
{
|
||||
pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _MANAGED
|
||||
@@ -114,25 +118,16 @@ struct sp_any_pointer
|
||||
template<class T> sp_any_pointer( T* ) {}
|
||||
};
|
||||
|
||||
inline void sp_enable_shared_from_this( shared_count const & /*pn*/, sp_any_pointer, sp_any_pointer )
|
||||
inline void sp_enable_shared_from_this( sp_any_pointer, sp_any_pointer, sp_any_pointer )
|
||||
{
|
||||
}
|
||||
|
||||
#else // _MANAGED
|
||||
|
||||
#ifdef sgi
|
||||
// Turn off: the last argument of the varargs function "sp_enable_shared_from_this" is unnamed
|
||||
# pragma set woff 3506
|
||||
#endif
|
||||
|
||||
inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... )
|
||||
inline void sp_enable_shared_from_this( ... )
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef sgi
|
||||
# pragma reset woff 3506
|
||||
#endif
|
||||
|
||||
#endif // _MANAGED
|
||||
|
||||
#if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_AUTO_PTR )
|
||||
@@ -182,7 +177,7 @@ public:
|
||||
template<class Y>
|
||||
explicit shared_ptr( Y * p ): px( p ), pn( p ) // Y must be complete
|
||||
{
|
||||
boost::detail::sp_enable_shared_from_this( pn, p, p );
|
||||
boost::detail::sp_enable_shared_from_this( this, p, p );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -193,14 +188,14 @@ public:
|
||||
|
||||
template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
|
||||
{
|
||||
boost::detail::sp_enable_shared_from_this( pn, p, p );
|
||||
boost::detail::sp_enable_shared_from_this( this, p, p );
|
||||
}
|
||||
|
||||
// As above, but with allocator. A's copy constructor shall not throw.
|
||||
|
||||
template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a )
|
||||
{
|
||||
boost::detail::sp_enable_shared_from_this( pn, p, p );
|
||||
boost::detail::sp_enable_shared_from_this( this, p, p );
|
||||
}
|
||||
|
||||
// generated copy constructor, assignment, destructor are fine...
|
||||
@@ -288,7 +283,7 @@ public:
|
||||
{
|
||||
Y * tmp = r.get();
|
||||
pn = boost::detail::shared_count(r);
|
||||
boost::detail::sp_enable_shared_from_this( pn, tmp, tmp );
|
||||
boost::detail::sp_enable_shared_from_this( this, tmp, tmp );
|
||||
}
|
||||
|
||||
#if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
|
||||
@@ -298,7 +293,7 @@ public:
|
||||
{
|
||||
typename Ap::element_type * tmp = r.get();
|
||||
pn = boost::detail::shared_count( r );
|
||||
boost::detail::sp_enable_shared_from_this( pn, tmp, tmp );
|
||||
boost::detail::sp_enable_shared_from_this( this, tmp, tmp );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user