asserted allocator equality on unordered_node_(map|set)::merge and updated docs

This commit is contained in:
joaquintides 2023-10-21 12:35:59 +02:00
parent ea4fc5e66d
commit dbe93c765c
4 changed files with 16 additions and 0 deletions

View File

@ -1216,6 +1216,12 @@ template<class H2, class P2>
Transfers all the element nodes from `source` whose key is not already present in `*this`.
[horizontal]
Requires:;; `this\->get_allocator() == source.get_allocator()`.
Notes:;; Invalidates iterators to the elements transferred.
If the resulting size of `*this` is greater than its original maximum load,
invalidates all iterators associated to `*this`.
---
=== Observers

View File

@ -1030,6 +1030,12 @@ template<class H2, class P2>
Transfers all the element nodes from `source` whose key is not already present in `*this`.
[horizontal]
Requires:;; `this\->get_allocator() == source.get_allocator()`.
Notes:;; Invalidates iterators to the elements transferred.
If the resulting size of `*this` is greater than its original maximum load,
invalidates all iterators associated to `*this`.
---
=== Observers

View File

@ -529,6 +529,7 @@ namespace boost {
unordered_node_map<key_type, mapped_type, H2, P2, allocator_type>&
source)
{
BOOST_ASSERT(get_allocator() == source.get_allocator());
table_.merge(source.table_);
}
@ -537,6 +538,7 @@ namespace boost {
unordered_node_map<key_type, mapped_type, H2, P2, allocator_type>&&
source)
{
BOOST_ASSERT(get_allocator() == source.get_allocator());
table_.merge(std::move(source.table_));
}

View File

@ -415,12 +415,14 @@ namespace boost {
template <class H2, class P2>
void merge(unordered_node_set<key_type, H2, P2, allocator_type>& source)
{
BOOST_ASSERT(get_allocator() == source.get_allocator());
table_.merge(source.table_);
}
template <class H2, class P2>
void merge(unordered_node_set<key_type, H2, P2, allocator_type>&& source)
{
BOOST_ASSERT(get_allocator() == source.get_allocator());
table_.merge(std::move(source.table_));
}