shared_ptr( p, d, a ) added.

[SVN r31613]
This commit is contained in:
Peter Dimov
2005-11-09 20:05:42 +00:00
parent 0127c06692
commit 25ca855127
3 changed files with 102 additions and 2 deletions
+14 -2
View File
@@ -146,6 +146,13 @@ public:
boost::detail::sp_enable_shared_from_this( pn, 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 );
}
// generated copy constructor, assignment, destructor are fine...
// except that Borland C++ has a bug, and g++ with -Wsynth warns
@@ -246,9 +253,14 @@ public:
this_type(p).swap(*this);
}
template<class Y, class D> void reset(Y * p, D d)
template<class Y, class D> void reset( Y * p, D d )
{
this_type(p, d).swap(*this);
this_type( p, d ).swap( *this );
}
template<class Y, class D, class A> void reset( Y * p, D d, A a )
{
this_type( p, d, a ).swap( *this );
}
reference operator* () const // never throws