]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/smart_ptr/atomic_shared_ptr.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / smart_ptr / atomic_shared_ptr.hpp
index d1efa8e28031f5a11f55065b706fd647cc368463..7c485070f832d088f35540f6b62954dd091c3250 100644 (file)
@@ -97,7 +97,13 @@ public:
         return false;
     }
 
-    shared_ptr<T> load( int = 0 ) const BOOST_SP_NOEXCEPT
+    shared_ptr<T> load() const BOOST_SP_NOEXCEPT
+    {
+        boost::detail::spinlock::scoped_lock lock( l_ );
+        return p_;
+    }
+
+    template<class M> shared_ptr<T> load( M ) const BOOST_SP_NOEXCEPT
     {
         boost::detail::spinlock::scoped_lock lock( l_ );
         return p_;
@@ -109,13 +115,19 @@ public:
         return p_;
     }
 
-    void store( shared_ptr<T> r, int = 0 ) BOOST_SP_NOEXCEPT
+    void store( shared_ptr<T> r ) BOOST_SP_NOEXCEPT
     {
         boost::detail::spinlock::scoped_lock lock( l_ );
         p_.swap( r );
     }
 
-    shared_ptr<T> exchange( shared_ptr<T> r, int = 0 ) BOOST_SP_NOEXCEPT
+    template<class M> void store( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT
+    {
+        boost::detail::spinlock::scoped_lock lock( l_ );
+        p_.swap( r );
+    }
+
+    shared_ptr<T> exchange( shared_ptr<T> r ) BOOST_SP_NOEXCEPT
     {
         {
             boost::detail::spinlock::scoped_lock lock( l_ );
@@ -133,44 +145,82 @@ public:
 #endif
     }
 
-    bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, int, int ) BOOST_SP_NOEXCEPT
+    template<class M> shared_ptr<T> exchange( shared_ptr<T> r, M ) BOOST_SP_NOEXCEPT
+    {
+        {
+            boost::detail::spinlock::scoped_lock lock( l_ );
+            p_.swap( r );
+        }
+
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+        return std::move( r );
+
+#else
+
+        return r;
+
+#endif
+    }
+
+    template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, w );
     }
 
-    bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, int = 0 ) BOOST_SP_NOEXCEPT
+    template<class M> bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, w );
     }
 
-    bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, int, int ) BOOST_SP_NOEXCEPT
+    bool compare_exchange_weak( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, w );
     }
 
-    bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, int = 0 ) BOOST_SP_NOEXCEPT
+    template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M, M ) BOOST_SP_NOEXCEPT
+    {
+        return compare_exchange( v, w );
+    }
+
+    template<class M> bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w, M ) BOOST_SP_NOEXCEPT
+    {
+        return compare_exchange( v, w );
+    }
+
+    bool compare_exchange_strong( shared_ptr<T>& v, const shared_ptr<T>& w ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, w );
     }
 
 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
 
-    bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, int, int ) BOOST_SP_NOEXCEPT
+    template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT
+    {
+        return compare_exchange( v, std::move( w ) );
+    }
+
+    template<class M> bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT
+    {
+        return compare_exchange( v, std::move( w ) );
+    }
+
+    bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, std::move( w ) );
     }
 
-    bool compare_exchange_weak( shared_ptr<T>& v, shared_ptr<T>&& w, int = 0 ) BOOST_SP_NOEXCEPT
+    template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M, M ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, std::move( w ) );
     }
 
-    bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, int, int ) BOOST_SP_NOEXCEPT
+    template<class M> bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, M ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, std::move( w ) );
     }
 
-    bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w, int = 0 ) BOOST_SP_NOEXCEPT
+    bool compare_exchange_strong( shared_ptr<T>& v, shared_ptr<T>&& w ) BOOST_SP_NOEXCEPT
     {
         return compare_exchange( v, std::move( w ) );
     }