Updated Borland workaround to properly use BOOST_NO_MEMBER_TEMPLATE_FRIENDS.

[SVN r45347]
This commit is contained in:
Peter Dimov
2008-05-14 00:21:28 +00:00
parent 05e050abe0
commit 31685fe551

View File

@@ -21,10 +21,14 @@
namespace boost
{
#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
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, void * /*pd*/ );
#endif
template< class T > class enable_shared_from_this
{
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:
@@ -90,7 +99,8 @@ public:
if( _weak_count.use_count() == 0 )
{
_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
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 );
}
}
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 )