flat_base: move swap()

This commit is contained in:
Justin Viiret 2017-01-20 16:20:22 +11:00 committed by Matthew Barr
parent f8166fac25
commit 1db7f30296

View 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 {