diff --git a/include/boost/intrusive_ptr.hpp b/include/boost/intrusive_ptr.hpp index 95cca04..c4ec407 100644 --- a/include/boost/intrusive_ptr.hpp +++ b/include/boost/intrusive_ptr.hpp @@ -105,6 +105,11 @@ public: return *this; } + void reset( T * rhs ) + { + this_type( rhs ).swap( *this ); + } + T * get() const { return p_; diff --git a/intrusive_ptr.html b/intrusive_ptr.html index 24d8c32..c4eb899 100644 --- a/intrusive_ptr.html +++ b/intrusive_ptr.html @@ -61,7 +61,8 @@ intrusive_ptr & operator=(intrusive_ptr const & r); template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> const & r); - template<class Y> intrusive_ptr & operator=(T * r); + intrusive_ptr & operator=(T * r); + void reset(T * r); T & operator*() const; // never throws T * operator->() const; // never throws @@ -146,6 +147,11 @@ intrusive_ptr & operator=(T * r);

Effects: Equivalent to intrusive_ptr(r).swap(*this).

Returns: *this.

+

reset

+
void reset(T * r);
+
+

Effects: Equivalent to intrusive_ptr(r).swap(*this).

+

indirection

T & operator*() const; // never throws