mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-01 21:54:28 +02:00
Updated Borland workaround to properly use BOOST_NO_MEMBER_TEMPLATE_FRIENDS.
[SVN r45347]
This commit is contained in:
@@ -21,10 +21,14 @@
|
|||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
|
||||||
|
|
||||||
template< class T > class enable_shared_from_this;
|
template< class T > class enable_shared_from_this;
|
||||||
template< class T, class Y > void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe );
|
template< class T, class Y > void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe );
|
||||||
template< class T, class Y > void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe, void * /*pd*/ );
|
template< class T, class Y > void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe, void * /*pd*/ );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template< class T > class enable_shared_from_this
|
template< class T > class enable_shared_from_this
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@@ -78,7 +82,12 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, <= 0x551 )
|
#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
|
||||||
|
|
||||||
|
template< class U, class Y > friend void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<U> const * pe );
|
||||||
|
template< class U, class Y > friend void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<U> const * pe, void * /*pd*/ );
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -90,7 +99,8 @@ public:
|
|||||||
if( _weak_count.use_count() == 0 )
|
if( _weak_count.use_count() == 0 )
|
||||||
{
|
{
|
||||||
_weak_count = owner.get_shared_count();
|
_weak_count = owner.get_shared_count();
|
||||||
}else if( !_shared_count.empty() )
|
}
|
||||||
|
else if( !_shared_count.empty() )
|
||||||
{
|
{
|
||||||
BOOST_ASSERT( owner.unique() ); // no weak_ptrs to owner should exist either, but there's no way to check that
|
BOOST_ASSERT( owner.unique() ); // no weak_ptrs to owner should exist either, but there's no way to check that
|
||||||
detail::sp_deleter_wrapper * pd = detail::basic_get_deleter<detail::sp_deleter_wrapper>( _shared_count );
|
detail::sp_deleter_wrapper * pd = detail::basic_get_deleter<detail::sp_deleter_wrapper>( _shared_count );
|
||||||
@@ -101,9 +111,6 @@ public:
|
|||||||
detail::shared_count().swap( _shared_count );
|
detail::shared_count().swap( _shared_count );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class U, class Y > friend void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<U> const * pe );
|
|
||||||
template< class U, class Y > friend void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<U> const * pe, void * /*pd*/ );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template< class T, class Y > inline void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe )
|
template< class T, class Y > inline void sp_accept_owner( shared_ptr<Y> * ptr, enable_shared_from_this<T> const * pe )
|
||||||
|
Reference in New Issue
Block a user