Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84507 - in branches/release: . libs libs/smart_ptr
From: pdimov_at_[hidden]
Date: 2013-05-26 09:39:05


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

Log:
Merge [84506] from trunk: Document that constructors initialize enable_shared_from_this. Fixes #8573.
Properties modified:
   branches/release/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/smart_ptr/ (props changed)
Text files modified:
   branches/release/libs/smart_ptr/shared_ptr.htm | 14 +++++++++++---
   1 files changed, 11 insertions(+), 3 deletions(-)

Modified: branches/release/libs/smart_ptr/shared_ptr.htm
==============================================================================
--- branches/release/libs/smart_ptr/shared_ptr.htm (original)
+++ branches/release/libs/smart_ptr/shared_ptr.htm 2013-05-26 09:39:04 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