]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/smart_ptr/weak_ptr.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / smart_ptr / weak_ptr.hpp
index 54d9ef3781291f848a7a3e318113dfb9a042c834..5230f35e68ded2d5a196f909c33c9f16f4c062c1 100644 (file)
@@ -137,6 +137,23 @@ public:
         boost::detail::sp_assert_convertible< Y, T >();
     }
 
+    // aliasing
+    template<class Y> weak_ptr(shared_ptr<Y> const & r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( r.pn )
+    {
+    }
+
+    template<class Y> weak_ptr(weak_ptr<Y> const & r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( r.pn )
+    {
+    }
+
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class Y> weak_ptr(weak_ptr<Y> && r, element_type * p) BOOST_SP_NOEXCEPT: px( p ), pn( std::move( r.pn ) )
+    {
+    }
+
+#endif
+
 #if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1300)
 
     template<class Y>
@@ -194,6 +211,11 @@ public:
         return pn.empty();
     }
 
+    bool empty() const BOOST_SP_NOEXCEPT // extension, not in std::weak_ptr
+    {
+        return pn.empty();
+    }
+
     void reset() BOOST_SP_NOEXCEPT
     {
         this_type().swap(*this);
@@ -205,13 +227,6 @@ public:
         pn.swap(other.pn);
     }
 
-    template<typename Y>
-    void _internal_aliasing_assign(weak_ptr<Y> const & r, element_type * px2) BOOST_SP_NOEXCEPT
-    {
-        px = px2;
-        pn = r.pn;
-    }
-
     template<class Y> bool owner_before( weak_ptr<Y> const & rhs ) const BOOST_SP_NOEXCEPT
     {
         return pn < rhs.pn;