diff --git a/include/boost/intrusive_ptr.hpp b/include/boost/intrusive_ptr.hpp index ace808b..8982fe9 100644 --- a/include/boost/intrusive_ptr.hpp +++ b/include/boost/intrusive_ptr.hpp @@ -126,6 +126,11 @@ public: return *this; } + void reset() + { + this_type().swap( *this ); + } + void reset( T * rhs ) { this_type( rhs ).swap( *this ); diff --git a/intrusive_ptr.html b/intrusive_ptr.html index c4eb899..16097dd 100644 --- a/intrusive_ptr.html +++ b/intrusive_ptr.html @@ -62,6 +62,8 @@ intrusive_ptr & operator=(intrusive_ptr const & r); template<class Y> intrusive_ptr & operator=(intrusive_ptr<Y> const & r); intrusive_ptr & operator=(T * r); + + void reset(); void reset(T * r); T & operator*() const; // never throws @@ -148,6 +150,10 @@ intrusive_ptr & operator=(T * r);

Returns: *this.

reset

+
void reset();
+
+

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

+
void reset(T * r);

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