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>;
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>
bool friend operator==(concurrent_flat_map<K, V, H, KE, A> const& lhs,
@ -248,10 +251,8 @@ namespace boost {
return *this;
}
concurrent_flat_map& operator=(concurrent_flat_map&& rhs)
noexcept(boost::allocator_is_always_equal<Allocator>::type::value ||
boost::allocator_propagate_on_container_move_assignment<
Allocator>::type::value)
concurrent_flat_map& operator=(concurrent_flat_map&& rhs) noexcept(
noexcept(std::declval<table_type&>() = std::declval<table_type&&>()))
{
table_ = std::move(rhs.table_);
return *this;

View File

@ -493,7 +493,8 @@ public:
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);
super::operator=(std::move(x));

View File

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

View File

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

View File

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

View File

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

View File

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