Update noexcept specification to accomodate for throwing arrays::new_

This commit is contained in:
Christian Mazakas
2023-09-05 15:31:18 -07:00
parent 33ee8ea302
commit c3786357a6
7 changed files with 33 additions and 38 deletions

View File

@ -92,7 +92,10 @@ namespace boost {
using type_policy = detail::foa::flat_map_types<Key, T>; using type_policy = detail::foa::flat_map_types<Key, T>;
detail::foa::concurrent_table<type_policy, Hash, Pred, Allocator> table_; using table_type =
detail::foa::concurrent_table<type_policy, Hash, Pred, Allocator>;
table_type table_;
template <class K, class V, class H, class KE, class A> template <class K, class V, class H, class KE, class A>
bool friend operator==(concurrent_flat_map<K, V, H, KE, A> const& lhs, bool friend operator==(concurrent_flat_map<K, V, H, KE, A> const& lhs,
@ -248,10 +251,8 @@ namespace boost {
return *this; return *this;
} }
concurrent_flat_map& operator=(concurrent_flat_map&& rhs) concurrent_flat_map& operator=(concurrent_flat_map&& rhs) noexcept(
noexcept(boost::allocator_is_always_equal<Allocator>::type::value || noexcept(std::declval<table_type&>() = std::declval<table_type&&>()))
boost::allocator_propagate_on_container_move_assignment<
Allocator>::type::value)
{ {
table_ = std::move(rhs.table_); table_ = std::move(rhs.table_);
return *this; return *this;

View File

@ -493,7 +493,8 @@ public:
return *this; return *this;
} }
concurrent_table& operator=(concurrent_table&& x) concurrent_table& operator=(concurrent_table&& x)noexcept(
noexcept(std::declval<super&>() = std::declval<super&&>()))
{ {
auto lck=exclusive_access(*this,x); auto lck=exclusive_access(*this,x);
super::operator=(std::move(x)); super::operator=(std::move(x));

View File

@ -1267,6 +1267,10 @@ public:
using element_type=typename type_policy::element_type; using element_type=typename type_policy::element_type;
using arrays_type=Arrays<element_type,group_type,size_policy,Allocator>; using arrays_type=Arrays<element_type,group_type,size_policy,Allocator>;
using size_ctrl_type=SizeControl; using size_ctrl_type=SizeControl;
static constexpr auto uses_fancy_pointers=!std::is_same<
typename alloc_traits::pointer,
typename alloc_traits::value_type*
>::value;
using key_type=typename type_policy::key_type; using key_type=typename type_policy::key_type;
using init_type=typename type_policy::init_type; using init_type=typename type_policy::init_type;
@ -1308,7 +1312,8 @@ public:
noexcept( noexcept(
std::is_nothrow_move_constructible<Hash>::value&& std::is_nothrow_move_constructible<Hash>::value&&
std::is_nothrow_move_constructible<Pred>::value&& std::is_nothrow_move_constructible<Pred>::value&&
std::is_nothrow_move_constructible<Allocator>::value): std::is_nothrow_move_constructible<Allocator>::value&&
!uses_fancy_pointers):
table_core{ table_core{
std::move(x.h()),std::move(x.pred()),std::move(x.al()), std::move(x.h()),std::move(x.pred()),std::move(x.al()),
x.arrays,x.size_ctrl} x.arrays,x.size_ctrl}
@ -1352,7 +1357,7 @@ public:
delete_arrays(arrays); delete_arrays(arrays);
} }
void empty_initialize()noexcept void empty_initialize()noexcept(!uses_fancy_pointers)
{ {
arrays=new_arrays(0); arrays=new_arrays(0);
size_ctrl.ml=initial_max_load(); size_ctrl.ml=initial_max_load();
@ -1404,8 +1409,8 @@ public:
table_core& operator=(table_core&& x) table_core& operator=(table_core&& x)
noexcept( noexcept(
alloc_traits::propagate_on_container_move_assignment::value|| (alloc_traits::propagate_on_container_move_assignment::value||
alloc_traits::is_always_equal::value) alloc_traits::is_always_equal::value)&&!uses_fancy_pointers)
{ {
BOOST_UNORDERED_STATIC_ASSERT_HASH_PRED(Hash, Pred) BOOST_UNORDERED_STATIC_ASSERT_HASH_PRED(Hash, Pred)

View File

@ -141,9 +141,7 @@ namespace boost {
} }
unordered_flat_map(unordered_flat_map&& other) unordered_flat_map(unordered_flat_map&& other)
noexcept(std::is_nothrow_move_constructible<hasher>::value&& noexcept(std::is_nothrow_move_constructible<table_type>::value)
std::is_nothrow_move_constructible<key_equal>::value&&
std::is_nothrow_move_constructible<allocator_type>::value)
: table_(std::move(other.table_)) : table_(std::move(other.table_))
{ {
} }
@ -697,10 +695,9 @@ namespace boost {
return erase_if(map.table_, pred); return erase_if(map.table_, pred);
} }
template <class Archive, template <class Archive, class Key, class T, class Hash, class KeyEqual,
class Key, class T, class Hash, class KeyEqual, class Allocator> class Allocator>
void serialize( void serialize(Archive& ar,
Archive & ar,
unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& map, unordered_flat_map<Key, T, Hash, KeyEqual, Allocator>& map,
unsigned int version) unsigned int version)
{ {

View File

@ -133,9 +133,7 @@ namespace boost {
} }
unordered_flat_set(unordered_flat_set&& other) unordered_flat_set(unordered_flat_set&& other)
noexcept(std::is_nothrow_move_constructible<hasher>::value&& noexcept(std::is_nothrow_move_constructible<table_type>::value)
std::is_nothrow_move_constructible<key_equal>::value&&
std::is_nothrow_move_constructible<allocator_type>::value)
: table_(std::move(other.table_)) : table_(std::move(other.table_))
{ {
} }
@ -506,10 +504,9 @@ namespace boost {
return erase_if(set.table_, pred); return erase_if(set.table_, pred);
} }
template <class Archive, template <class Archive, class Key, class Hash, class KeyEqual,
class Key, class Hash, class KeyEqual, class Allocator> class Allocator>
void serialize( void serialize(Archive& ar,
Archive & ar,
unordered_flat_set<Key, Hash, KeyEqual, Allocator>& set, unordered_flat_set<Key, Hash, KeyEqual, Allocator>& set,
unsigned int version) unsigned int version)
{ {

View File

@ -180,9 +180,7 @@ namespace boost {
} }
unordered_node_map(unordered_node_map&& other) unordered_node_map(unordered_node_map&& other)
noexcept(std::is_nothrow_move_constructible<hasher>::value&& noexcept(std::is_nothrow_move_constructible<table_type>::value)
std::is_nothrow_move_constructible<key_equal>::value&&
std::is_nothrow_move_constructible<allocator_type>::value)
: table_(std::move(other.table_)) : table_(std::move(other.table_))
{ {
} }
@ -790,10 +788,9 @@ namespace boost {
return erase_if(map.table_, pred); return erase_if(map.table_, pred);
} }
template <class Archive, template <class Archive, class Key, class T, class Hash, class KeyEqual,
class Key, class T, class Hash, class KeyEqual, class Allocator> class Allocator>
void serialize( void serialize(Archive& ar,
Archive & ar,
unordered_node_map<Key, T, Hash, KeyEqual, Allocator>& map, unordered_node_map<Key, T, Hash, KeyEqual, Allocator>& map,
unsigned int version) unsigned int version)
{ {

View File

@ -170,9 +170,7 @@ namespace boost {
} }
unordered_node_set(unordered_node_set&& other) unordered_node_set(unordered_node_set&& other)
noexcept(std::is_nothrow_move_constructible<hasher>::value&& noexcept(std::is_nothrow_move_constructible<table_type>::value)
std::is_nothrow_move_constructible<key_equal>::value&&
std::is_nothrow_move_constructible<allocator_type>::value)
: table_(std::move(other.table_)) : table_(std::move(other.table_))
{ {
} }
@ -603,10 +601,9 @@ namespace boost {
return erase_if(set.table_, pred); return erase_if(set.table_, pred);
} }
template <class Archive, template <class Archive, class Key, class Hash, class KeyEqual,
class Key, class Hash, class KeyEqual, class Allocator> class Allocator>
void serialize( void serialize(Archive& ar,
Archive & ar,
unordered_node_set<Key, Hash, KeyEqual, Allocator>& set, unordered_node_set<Key, Hash, KeyEqual, Allocator>& set,
unsigned int version) unsigned int version)
{ {