Boost logo

Boost-Commit :

From: pdimov_at_[hidden]
Date: 2008-02-19 08:18:59


Author: pdimov
Date: 2008-02-19 08:18:58 EST (Tue, 19 Feb 2008)
New Revision: 43316
URL: http://svn.boost.org/trac/boost/changeset/43316

Log:
Fixes #1590.
Text files modified:
   trunk/libs/smart_ptr/shared_ptr.htm | 10 +++++-----
   trunk/libs/smart_ptr/test/shared_ptr_test.cpp | 12 ++++++++++++
   2 files changed, 17 insertions(+), 5 deletions(-)

Modified: trunk/libs/smart_ptr/shared_ptr.htm
==============================================================================
--- trunk/libs/smart_ptr/shared_ptr.htm (original)
+++ trunk/libs/smart_ptr/shared_ptr.htm 2008-02-19 08:18:58 EST (Tue, 19 Feb 2008)
@@ -373,8 +373,8 @@
                 <pre>long use_count() const; // never throws</pre>
                 <blockquote>
                         <p><b>Returns:</b> the number of <b>shared_ptr</b> objects, <STRONG>*this</STRONG> included,
- that <i>share ownership</i> with <b>*this</b>, or an unspecified nonnegative
- value when <STRONG>*this</STRONG> is <EM>empty</EM>.</p>
+ that <i>share ownership</i> with <b>*this</b>, or 0 when <STRONG>*this</STRONG>
+ is <EM>empty</EM>.</p>
                         <p><b>Throws:</b> nothing.</p>
                         <P><B>Notes:</B> <code>use_count()</code> is not necessarily efficient. Use only
                                 for debugging and testing purposes, not for production code.</P>
@@ -709,8 +709,8 @@
                 <p>
                         $Date$</p>
                 <p><small>Copyright 1999 Greg Colvin and Beman Dawes. Copyright 2002 Darin Adler.
- Copyright 2002-2005 Peter Dimov. Distributed under the Boost Software License, Version
- 1.0. See accompanying file LICENSE_1_0.txt or
- copy at http://www.boost.org/LICENSE_1_0.txt.</small></p>
+ Copyright 2002-2005 Peter Dimov. Distributed under the Boost Software License,
+ Version 1.0. See accompanying file LICENSE_1_0.txt
+ or copy at http://www.boost.org/LICENSE_1_0.txt.</small></p>
         </body>
 </html>

Modified: trunk/libs/smart_ptr/test/shared_ptr_test.cpp
==============================================================================
--- trunk/libs/smart_ptr/test/shared_ptr_test.cpp (original)
+++ trunk/libs/smart_ptr/test/shared_ptr_test.cpp 2008-02-19 08:18:58 EST (Tue, 19 Feb 2008)
@@ -62,6 +62,7 @@
         BOOST_TEST(pi? false: true);
         BOOST_TEST(!pi);
         BOOST_TEST(pi.get() == 0);
+ BOOST_TEST(pi.use_count() == 0);
     }
 
     {
@@ -69,6 +70,7 @@
         BOOST_TEST(pv? false: true);
         BOOST_TEST(!pv);
         BOOST_TEST(pv.get() == 0);
+ BOOST_TEST(pv.use_count() == 0);
     }
 
     {
@@ -76,6 +78,7 @@
         BOOST_TEST(px? false: true);
         BOOST_TEST(!px);
         BOOST_TEST(px.get() == 0);
+ BOOST_TEST(px.use_count() == 0);
     }
 }
 
@@ -1565,6 +1568,7 @@
         BOOST_TEST(pi? false: true);
         BOOST_TEST(!pi);
         BOOST_TEST(pi.get() == 0);
+ BOOST_TEST(pi.use_count() == 0);
     }
 
     {
@@ -1573,6 +1577,7 @@
         BOOST_TEST(pi? false: true);
         BOOST_TEST(!pi);
         BOOST_TEST(pi.get() == 0);
+ BOOST_TEST(pi.use_count() == 0);
     }
 
     {
@@ -1581,6 +1586,7 @@
         BOOST_TEST(pi? false: true);
         BOOST_TEST(!pi);
         BOOST_TEST(pi.get() == 0);
+ BOOST_TEST(pi.use_count() == 0);
     }
 
     {
@@ -1589,6 +1595,7 @@
         BOOST_TEST(px? false: true);
         BOOST_TEST(!px);
         BOOST_TEST(px.get() == 0);
+ BOOST_TEST(px.use_count() == 0);
     }
 
     {
@@ -1597,6 +1604,7 @@
         BOOST_TEST(px? false: true);
         BOOST_TEST(!px);
         BOOST_TEST(px.get() == 0);
+ BOOST_TEST(px.use_count() == 0);
     }
 
     {
@@ -1605,6 +1613,7 @@
         BOOST_TEST(px? false: true);
         BOOST_TEST(!px);
         BOOST_TEST(px.get() == 0);
+ BOOST_TEST(px.use_count() == 0);
     }
 
     {
@@ -1615,6 +1624,7 @@
         BOOST_TEST(px? false: true);
         BOOST_TEST(!px);
         BOOST_TEST(px.get() == 0);
+ BOOST_TEST(px.use_count() == 0);
         BOOST_TEST(X::instances == 0);
     }
 
@@ -1624,6 +1634,7 @@
         BOOST_TEST(pv? false: true);
         BOOST_TEST(!pv);
         BOOST_TEST(pv.get() == 0);
+ BOOST_TEST(pv.use_count() == 0);
     }
 
     {
@@ -1634,6 +1645,7 @@
         BOOST_TEST(pv? false: true);
         BOOST_TEST(!pv);
         BOOST_TEST(pv.get() == 0);
+ BOOST_TEST(pv.use_count() == 0);
         BOOST_TEST(X::instances == 0);
     }
 }


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