forked from boostorg/smart_ptr
Fixed sp_enable_shared_from_this to not use void cv * since this breaks function types.
[SVN r24718]
This commit is contained in:
@@ -82,12 +82,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(boost::enable_shared_from_this<T> const * pe, Y const * px, shared_count const & pn)
|
||||
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 )
|
||||
{
|
||||
if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast<Y*>(px), pn);
|
||||
}
|
||||
|
||||
inline void sp_enable_shared_from_this(void const volatile *, void const volatile *, shared_count const &)
|
||||
inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
template<class Y>
|
||||
explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter<Y>()) // Y must be complete
|
||||
{
|
||||
detail::sp_enable_shared_from_this(p, p, pn);
|
||||
detail::sp_enable_shared_from_this( pn, p, p );
|
||||
}
|
||||
|
||||
//
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
|
||||
template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
|
||||
{
|
||||
detail::sp_enable_shared_from_this(p, p, pn);
|
||||
detail::sp_enable_shared_from_this( pn, p, p );
|
||||
}
|
||||
|
||||
// generated copy constructor, assignment, destructor are fine...
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
{
|
||||
Y * tmp = r.get();
|
||||
pn = detail::shared_count(r);
|
||||
detail::sp_enable_shared_from_this(tmp, tmp, pn);
|
||||
detail::sp_enable_shared_from_this( pn, tmp, tmp );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user