add swap noexcept

This commit is contained in:
2019-05-12 17:12:45 +07:00
parent 574de9c995
commit 05934cac38
8 changed files with 118 additions and 142 deletions

View File

@@ -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);
}