Bring back the constructor-enabled enable_shared_from_this as enable_shared_from_this2.

[SVN r51912]
This commit is contained in:
Peter Dimov
2009-03-22 21:11:17 +00:00
parent 6f2bdddfa0
commit d34d638998
5 changed files with 254 additions and 72 deletions

View File

@@ -61,6 +61,7 @@ namespace boost
template<class T> class shared_ptr;
template<class T> class weak_ptr;
template<class T> class enable_shared_from_this;
template<class T> class enable_shared_from_this2;
namespace detail
{
@@ -109,6 +110,14 @@ template< class X, class Y, class T > inline void sp_enable_shared_from_this( bo
}
}
template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> * ppx, Y const * py, boost::enable_shared_from_this2< T > const * pe )
{
if( pe != 0 )
{
pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) );
}
}
#ifdef _MANAGED
// Avoid C4793, ... causes native code generation