From a2c5208b8ec20988759bc2505e0cf2e62e61fdfd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 28 Feb 2009 19:59:56 +0000 Subject: [PATCH] Sync shared_count.hpp with trunk. [SVN r51484] --- include/boost/detail/shared_count.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/boost/detail/shared_count.hpp b/include/boost/detail/shared_count.hpp index 8f13777..9e9b1ba 100644 --- a/include/boost/detail/shared_count.hpp +++ b/include/boost/detail/shared_count.hpp @@ -28,6 +28,7 @@ #include #include #include +#include // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to // pull in the TR1 headers: that's why we use this header @@ -227,6 +228,18 @@ public: 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 @@ public: 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_;