mirror of
https://github.com/BlackMATov/flat.hpp.git
synced 2025-12-16 22:16:58 +07:00
add swap noexcept
This commit is contained in:
@@ -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