]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
flat_base: move swap()
authorJustin Viiret <justin.viiret@intel.com>
Fri, 20 Jan 2017 05:20:22 +0000 (16:20 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 26 Apr 2017 04:41:30 +0000 (14:41 +1000)
src/util/ue2_containers.h

index 43376a0f7d35dad2e1a44fa85ce63a71d2340f03..924cae95128c1110fff686c45aa5e3b53e2698a5 100644 (file)
@@ -137,6 +137,12 @@ public:
     void clear() {
         data().clear();
     }
+
+    void swap(flat_base &a) {
+        using std::swap;
+        swap(comp(), a.comp());
+        swap(data(), a.data());
+    }
 };
 
 } // namespace flat_detail
@@ -210,7 +216,6 @@ public:
     flat_set &operator=(const flat_set &) = default;
     flat_set &operator=(flat_set &&) = default;
 
-
     // Iterators.
 
     iterator begin() { return iterator(data().begin()); }
@@ -291,12 +296,6 @@ public:
         }
     }
 
-    void swap(flat_set &a) {
-        using std::swap;
-        swap(comp(), a.comp());
-        swap(data(), a.data());
-    }
-
     // Lookup.
 
     size_type count(const value_type &value) const {
@@ -546,12 +545,6 @@ public:
         }
     }
 
-    void swap(flat_map &a) {
-        using std::swap;
-        swap(comp(), a.comp());
-        swap(data(), a.data());
-    }
-
     // Lookup.
 
     size_type count(const key_type &key) const {