Add swap_tests

This commit is contained in:
Christian Mazakas
2022-10-10 14:18:11 -07:00
parent 72bca09429
commit 09f0b7c0a8
4 changed files with 84 additions and 10 deletions
@@ -295,6 +295,12 @@ namespace boost {
return table_.erase(key);
}
void swap(unordered_flat_map& rhs) noexcept(
noexcept(std::declval<table_type&>().swap(std::declval<table_type&>())))
{
table_.swap(rhs.table_);
}
/// Lookup
///
@@ -493,6 +499,14 @@ namespace boost {
{
return !(lhs == rhs);
}
template <class Key, class T, class Hash, class KeyEqual, class Allocator>
void swap(unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& lhs,
unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& rhs)
noexcept(noexcept(lhs.swap(rhs)))
{
lhs.swap(rhs);
}
} // namespace unordered
} // namespace boost
@@ -223,6 +223,12 @@ namespace boost {
return table_.erase(key);
}
void swap(unordered_flat_set& rhs) noexcept(
noexcept(std::declval<table_type&>().swap(std::declval<table_type&>())))
{
table_.swap(rhs.table_);
}
/// Lookup
///
@@ -390,6 +396,14 @@ namespace boost {
{
return !(lhs == rhs);
}
template <class Key, class Hash, class KeyEqual, class Allocator>
void swap(unordered_flat_set<Key, Hash, KeyEqual, Allocator>& lhs,
unordered_flat_set<Key, Hash, KeyEqual, Allocator>& rhs)
noexcept(noexcept(lhs.swap(rhs)))
{
lhs.swap(rhs);
}
} // namespace unordered
} // namespace boost