Add add_ref parameter to intrusive_ptr::reset, add tests for reset.

This commit is contained in:
Peter Dimov
2013-12-26 18:47:05 +02:00
parent 4e46cb0609
commit 4de3f36839
3 changed files with 221 additions and 10 deletions
+6 -3
View File
@@ -67,6 +67,7 @@
void <a href="#reset" >reset</a>();
void <a href="#reset" >reset</a>(T * r);
void <a href="#reset" >reset</a>(T * r, bool add_ref);
T &amp; <A href="#indirection" >operator*</A>() const; // never throws
T * <A href="#indirection" >operator-&gt;</A>() const; // never throws
@@ -161,6 +162,10 @@ intrusive_ptr &amp; operator=(T * r);</pre>
<BLOCKQUOTE>
<P><B>Effects:</B> Equivalent to <code>intrusive_ptr(r).swap(*this)</code>.</P>
</BLOCKQUOTE>
<pre>void reset(T * r, bool add_ref);</pre>
<BLOCKQUOTE>
<P><B>Effects:</B> Equivalent to <code>intrusive_ptr(r, add_ref).swap(*this)</code>.</P>
</BLOCKQUOTE>
<h3><a name="indirection">indirection</a></h3>
<pre>T &amp; operator*() const; // never throws</pre>
<blockquote>
@@ -307,9 +312,7 @@ intrusive_ptr &amp; operator=(T * r);</pre>
</BLOCKQUOTE>
<hr>
<p>
$Date$</p>
<p>
<small>Copyright © 2003-2005 Peter Dimov. Distributed under the Boost Software License, Version
<small>Copyright © 2003-2005, 2013 Peter Dimov. Distributed under the Boost Software License, Version
1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
</body>