mirror of
https://github.com/BlackMATov/flat.hpp.git
synced 2025-12-16 14:09:01 +07:00
add swap noexcept
This commit is contained in:
@@ -319,7 +319,10 @@ namespace flat_hpp
|
||||
: 0;
|
||||
}
|
||||
|
||||
void swap(flat_map& other) {
|
||||
void swap(flat_map& other)
|
||||
noexcept(std::is_nothrow_swappable_v<base_type>
|
||||
&& std::is_nothrow_swappable_v<container_type>)
|
||||
{
|
||||
using std::swap;
|
||||
swap(
|
||||
static_cast<base_type&>(*this),
|
||||
@@ -397,6 +400,7 @@ namespace flat_hpp
|
||||
void swap(
|
||||
flat_map<Key, Value, Compare, Container>& l,
|
||||
flat_map<Key, Value, Compare, Container>& r)
|
||||
noexcept(noexcept(l.swap(r)))
|
||||
{
|
||||
l.swap(r);
|
||||
}
|
||||
|
||||
@@ -315,7 +315,10 @@ namespace flat_hpp
|
||||
return r;
|
||||
}
|
||||
|
||||
void swap(flat_multimap& other) {
|
||||
void swap(flat_multimap& other)
|
||||
noexcept(std::is_nothrow_swappable_v<base_type>
|
||||
&& std::is_nothrow_swappable_v<container_type>)
|
||||
{
|
||||
using std::swap;
|
||||
swap(
|
||||
static_cast<base_type&>(*this),
|
||||
@@ -393,6 +396,7 @@ namespace flat_hpp
|
||||
void swap(
|
||||
flat_multimap<Key, Value, Compare, Container>& l,
|
||||
flat_multimap<Key, Value, Compare, Container>& r)
|
||||
noexcept(noexcept(l.swap(r)))
|
||||
{
|
||||
l.swap(r);
|
||||
}
|
||||
|
||||
@@ -230,7 +230,10 @@ namespace flat_hpp
|
||||
return r;
|
||||
}
|
||||
|
||||
void swap(flat_multiset& other) {
|
||||
void swap(flat_multiset& other)
|
||||
noexcept(std::is_nothrow_swappable_v<base_type>
|
||||
&& std::is_nothrow_swappable_v<container_type>)
|
||||
{
|
||||
using std::swap;
|
||||
swap(
|
||||
static_cast<base_type&>(*this),
|
||||
@@ -301,6 +304,7 @@ namespace flat_hpp
|
||||
void swap(
|
||||
flat_multiset<Key, Compare, Container>& l,
|
||||
flat_multiset<Key, Compare, Container>& r)
|
||||
noexcept(noexcept(l.swap(r)))
|
||||
{
|
||||
l.swap(r);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,10 @@ namespace flat_hpp
|
||||
: 0;
|
||||
}
|
||||
|
||||
void swap(flat_set& other) {
|
||||
void swap(flat_set& other)
|
||||
noexcept(std::is_nothrow_swappable_v<base_type>
|
||||
&& std::is_nothrow_swappable_v<container_type>)
|
||||
{
|
||||
using std::swap;
|
||||
swap(
|
||||
static_cast<base_type&>(*this),
|
||||
@@ -305,6 +308,7 @@ namespace flat_hpp
|
||||
void swap(
|
||||
flat_set<Key, Compare, Container>& l,
|
||||
flat_set<Key, Compare, Container>& r)
|
||||
noexcept(noexcept(l.swap(r)))
|
||||
{
|
||||
l.swap(r);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user