Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84506 - trunk/libs/smart_ptr
From: pdimov_at_[hidden]
Date: 2013-05-26 09:34:41


Author: pdimov
Date: 2013-05-26 09:34:40 EDT (Sun, 26 May 2013)
New Revision: 84506
URL: http://svn.boost.org/trac/boost/changeset/84506

Log:
Document that constructors initialize enable_shared_from_this. Refs #8573.
Text files modified:
   trunk/libs/smart_ptr/shared_ptr.htm | 14 +++++++++++---
   1 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/libs/smart_ptr/shared_ptr.htm
==============================================================================
--- trunk/libs/smart_ptr/shared_ptr.htm (original)
+++ trunk/libs/smart_ptr/shared_ptr.htm 2013-05-26 09:34:40 EDT (Sun, 26 May 2013)
@@ -262,8 +262,12 @@
                             the pointer <code>p</code>.
                             Otherwise, constructs a <code>shared_ptr</code> that <em>owns</em>
                             <code>p</code> and a deleter of an unspecified type that calls <code>delete[] p</code>.</p>
- <p><b>Postconditions:</b> <code>use_count() == 1 &amp;&amp; get() == p</code>.</p>
- <p><b>Throws:</b> <code>std::bad_alloc</code>, or an implementation-defined
+ <p><b>Postconditions:</b> <code>use_count() == 1 &amp;&amp; get() == p</code>.
+ If <code>T</code> is not an array type and <code>p</code> is unambiguously convertible to <code>
+ enable_shared_from_this&lt;V&gt;*</code>
+ for some <code>V</code>, <code>p-&gt;shared_from_this()</code> returns a copy of
+ <code>*this</code>.</p>
+ <p><b>Throws:</b> <code>std::bad_alloc</code>, or an implementation-defined
                                 exception when a resource other than memory could not be obtained.</p>
                         <p><b>Exception safety:</b> If an exception is thrown, the constructor calls
                             <code>delete[] p</code>, when <code>T</code> is an array type,
@@ -296,7 +300,11 @@
                         <p><b>Effects:</b> Constructs a <code>shared_ptr</code> that <em>owns</em> the pointer <code>
                                         p</code> and the deleter <code>d</code>. The constructors taking an allocator <code>a</code>
                                         allocate memory using a copy of <code>a</code>.</p>
- <p><b>Postconditions:</b> <code>use_count() == 1 &amp;&amp; get() == p</code>.</p>
+ <p><b>Postconditions:</b> <code>use_count() == 1 &amp;&amp; get() == p</code>.
+ If <code>T</code> is not an array type and <code>p</code> is unambiguously convertible to <code>
+ enable_shared_from_this&lt;V&gt;*</code>
+ for some <code>V</code>, <code>p-&gt;shared_from_this()</code> returns a copy of
+ <code>*this</code>.</p>
                         <p><b>Throws:</b> <code>std::bad_alloc</code>, or an implementation-defined
                                 exception when a resource other than memory could not be obtained.</p>
                         <p><b>Exception safety:</b> If an exception is thrown, <code>d(p)</code> is called.</p>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk