move input shared_ptr in atomic_shared_ptr constructor
[folly.git] / folly / experimental / AtomicSharedPtr.h
index 6e4ef54a36eab5f2649adab5e6fac68f29f27fa3..7e8dce051991730a29dc199fc2431500c7d0ab7d 100644 (file)
@@ -81,7 +81,7 @@ class atomic_shared_ptr {
   }
   explicit atomic_shared_ptr(SharedPtr foo) /* noexcept */
       : atomic_shared_ptr() {
-    store(foo);
+    store(std::move(foo));
   }
   atomic_shared_ptr(const atomic_shared_ptr<T>&) = delete;
 
@@ -89,7 +89,7 @@ class atomic_shared_ptr {
     store(SharedPtr(nullptr));
   }
   void operator=(SharedPtr desired) /* noexcept */ {
-    store(desired);
+    store(std::move(desired));
   }
   void operator=(const atomic_shared_ptr<T>&) = delete;