Update SSLContext to use folly::Random and discrete_distribution
[folly.git] / folly / AtomicLinkedList.h
index 7e9db6bd2117f8ef04d84198caf387cb7b150741..f24746a5d1f6f8e0f7c234f75f5dfd2d1a99853a 100644 (file)
@@ -44,12 +44,26 @@ template <class T, AtomicLinkedListHook<T> T::* HookMember>
 class AtomicLinkedList {
  public:
   AtomicLinkedList() {}
+  AtomicLinkedList(const AtomicLinkedList&) = delete;
+  AtomicLinkedList& operator=(const AtomicLinkedList&) = delete;
+  AtomicLinkedList(AtomicLinkedList&& other) noexcept {
+    auto tmp = other.head_.load();
+    other.head_ = head_.load();
+    head_ = tmp;
+  }
+  AtomicLinkedList& operator=(AtomicLinkedList&& other) noexcept {
+    auto tmp = other.head_.load();
+    other.head_ = head_.load();
+    head_ = tmp;
+
+    return *this;
+  }
 
   /**
    * Note: list must be empty on destruction.
    */
   ~AtomicLinkedList() {
-    assert(head_ == nullptr);
+    assert(empty());
   }
 
   bool empty() const {