Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51484 - branches/release/boost/detail
From: pdimov_at_[hidden]
Date: 2009-02-28 14:59:57


Author: pdimov
Date: 2009-02-28 14:59:56 EST (Sat, 28 Feb 2009)
New Revision: 51484
URL: http://svn.boost.org/trac/boost/changeset/51484

Log:
Sync shared_count.hpp with trunk.
Text files modified:
   branches/release/boost/detail/shared_count.hpp | 18 ++++++++++++++++++
   1 files changed, 18 insertions(+), 0 deletions(-)

Modified: branches/release/boost/detail/shared_count.hpp
==============================================================================
--- branches/release/boost/detail/shared_count.hpp (original)
+++ branches/release/boost/detail/shared_count.hpp 2009-02-28 14:59:56 EST (Sat, 28 Feb 2009)
@@ -28,6 +28,7 @@
 #include <boost/detail/bad_weak_ptr.hpp>
 #include <boost/detail/sp_counted_base.hpp>
 #include <boost/detail/sp_counted_impl.hpp>
+#include <boost/detail/workaround.hpp>
 // In order to avoid circular dependencies with Boost.TR1
 // we make sure that our include of <memory> doesn't try to
 // pull in the TR1 headers: that's why we use this header
@@ -227,6 +228,18 @@
         if( pi_ != 0 ) pi_->add_ref_copy();
     }
 
+#if defined( BOOST_HAS_RVALUE_REFS )
+
+ shared_count(shared_count && r): pi_(r.pi_) // nothrow
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ , id_(shared_count_id)
+#endif
+ {
+ r.pi_ = 0;
+ }
+
+#endif
+
     explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
     shared_count( weak_count const & r, sp_nothrow_tag ); // constructs an empty *this when r.use_count() == 0
 
@@ -368,6 +381,11 @@
         return pi_ != 0? pi_->use_count(): 0;
     }
 
+ bool empty() const // nothrow
+ {
+ return pi_ == 0;
+ }
+
     friend inline bool operator==(weak_count const & a, weak_count const & b)
     {
         return a.pi_ == b.pi_;


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