diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 3d11e0e..cf6789e 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -3473,14 +3473,19 @@ public: return it == end() ? node_type() : extract(const_iterator{it}); } - void swap(parallel_hash_set& that) noexcept( - IsNoThrowSwappable() && - (!AllocTraits::propagate_on_container_swap::value || - IsNoThrowSwappable())) { + template + void swap(parallel_hash_set& that) + noexcept(IsNoThrowSwappable() && + (!AllocTraits::propagate_on_container_swap::value || + IsNoThrowSwappable())) + { using std::swap; + using Lockable2 = phmap::LockableImpl; + for (size_t i=0; i friend void swap(parallel_hash_set& a, - parallel_hash_set& b) noexcept(noexcept(a.swap(b))) { + parallel_hash_set& b) + noexcept(noexcept(a.swap(b))) + { a.swap(b); } @@ -3700,14 +3708,16 @@ private: // TODO(alkis): Optimize this assuming *this and that don't overlap. // -------------------------------------------------------------------- - parallel_hash_set& move_assign(parallel_hash_set&& that, std::true_type) { - parallel_hash_set tmp(std::move(that)); + template + parallel_hash_set& move_assign(parallel_hash_set&& that, std::true_type) { + parallel_hash_set tmp(std::move(that)); swap(tmp); return *this; } - parallel_hash_set& move_assign(parallel_hash_set&& that, std::false_type) { - parallel_hash_set tmp(std::move(that), alloc_ref()); + template + parallel_hash_set& move_assign(parallel_hash_set&& that, std::false_type) { + parallel_hash_set tmp(std::move(that), alloc_ref()); swap(tmp); return *this; }