]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/smart_ptr/shared_ptr.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / smart_ptr / shared_ptr.hpp
index 4264b06625d2ca2e596ed5dd6cbd9dc797d7d729..386ac099c64a90d8cf30c721f9135282f46f0d6f 100644 (file)
@@ -374,39 +374,81 @@ public:
     }
 
     //
-    // Requirements: D's copy constructor must not throw
+    // Requirements: D's copy/move constructors must not throw
     //
     // shared_ptr will release p by calling d(p)
     //
 
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
+    {
+        boost::detail::sp_deleter_construct( this, p );
+    }
+
+#else
+
     template<class Y, class D> shared_ptr( Y * p, D d ): px( p ), pn( p, d )
     {
         boost::detail::sp_deleter_construct( this, p );
     }
 
+#endif
+
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class D> shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, static_cast< D&& >( d ) )
+    {
+    }
+
+#else
+
     template<class D> shared_ptr( boost::detail::sp_nullptr_t p, D d ): px( p ), pn( p, d )
     {
     }
 
+#endif
+
 #endif
 
     // As above, but with allocator. A's copy constructor shall not throw.
 
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
+    {
+        boost::detail::sp_deleter_construct( this, p );
+    }
+
+#else
+
     template<class Y, class D, class A> shared_ptr( Y * p, D d, A a ): px( p ), pn( p, d, a )
     {
         boost::detail::sp_deleter_construct( this, p );
     }
 
+#endif
+
 #if !defined( BOOST_NO_CXX11_NULLPTR )
 
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, static_cast< D&& >( d ), a )
+    {
+    }
+
+#else
+
     template<class D, class A> shared_ptr( boost::detail::sp_nullptr_t p, D d, A a ): px( p ), pn( p, d, a )
     {
     }
 
 #endif
 
+#endif
+
 //  generated copy constructor, destructor are fine...
 
 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
@@ -693,6 +735,20 @@ public:
         this_type( p ).swap( *this );
     }
 
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+    template<class Y, class D> void reset( Y * p, D d )
+    {
+        this_type( p, static_cast< D&& >( d ) ).swap( *this );
+    }
+
+    template<class Y, class D, class A> void reset( Y * p, D d, A a )
+    {
+        this_type( p, static_cast< D&& >( d ), a ).swap( *this );
+    }
+
+#else
+
     template<class Y, class D> void reset( Y * p, D d )
     {
         this_type( p, d ).swap( *this );
@@ -703,6 +759,8 @@ public:
         this_type( p, d, a ).swap( *this );
     }
 
+#endif
+
     template<class Y> void reset( shared_ptr<Y> const & r, element_type * p ) BOOST_SP_NOEXCEPT
     {
         this_type( r, p ).swap( *this );