This commit is contained in:
joaquintides 2023-08-25 19:45:16 +02:00
parent d007a5a7bd
commit ca2a46f290
6 changed files with 27 additions and 22 deletions

View File

@ -120,12 +120,12 @@ to normal separate chaining implementations.
#include <boost/core/allocator_access.hpp>
#include <boost/core/bit.hpp>
#include <boost/core/empty_value.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/serialization.hpp>
#include <boost/cstdint.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/swap.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
@ -651,7 +651,7 @@ namespace boost {
bool b = boost::allocator_propagate_on_container_swap<
allocator_type>::type::value;
if (b) {
boost::swap(get_node_allocator(), other.get_node_allocator());
boost::core::invoke_swap(get_node_allocator(), other.get_node_allocator());
}
}

View File

@ -17,6 +17,7 @@
#include <boost/assert.hpp>
#include <boost/core/allocator_traits.hpp>
#include <boost/core/bit.hpp>
#include <boost/core/invoke_swap.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/pointer_traits.hpp>
#include <boost/core/serialization.hpp>
@ -30,7 +31,6 @@
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/swap.hpp>
#include <boost/throw_exception.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/add_lvalue_reference.hpp>
@ -260,8 +260,8 @@ namespace boost {
void swap(compressed& x)
{
boost::swap(first(), x.first());
boost::swap(second(), x.second());
boost::core::invoke_swap(first(), x.first());
boost::core::invoke_swap(second(), x.second());
}
private:
@ -644,7 +644,7 @@ namespace boost {
move(x);
}
} else if (has_value_) {
boost::swap(value_.value(), x.value_.value());
boost::core::invoke_swap(value_.value(), x.value_.value());
}
}
@ -2089,7 +2089,7 @@ namespace boost {
x.switch_functions();
buckets_.swap(x.buckets_);
boost::swap(size_, x.size_);
boost::core::invoke_swap(size_, x.size_);
std::swap(mlf_, x.mlf_);
std::swap(max_load_, x.max_load_);
}
@ -2098,7 +2098,7 @@ namespace boost {
void swap(table& x, true_type)
{
buckets_.swap(x.buckets_);
boost::swap(size_, x.size_);
boost::core::invoke_swap(size_, x.size_);
std::swap(mlf_, x.mlf_);
std::swap(max_load_, x.max_load_);
this->current_functions().swap(x.current_functions());

View File

@ -2980,9 +2980,9 @@ namespace boost {
if (boost::allocator_propagate_on_container_swap<
value_allocator>::type::value ||
!alloc_.has_value() || !n.alloc_.has_value()) {
boost::swap(alloc_, n.alloc_);
boost::core::invoke_swap(alloc_, n.alloc_);
}
boost::swap(ptr_, n.ptr_);
boost::core::invoke_swap(ptr_, n.ptr_);
}
};
@ -3029,9 +3029,9 @@ namespace boost {
void swap(insert_return_type_map<Iter, NodeType>& x,
insert_return_type_map<Iter, NodeType>& y)
{
boost::swap(x.node, y.node);
boost::swap(x.inserted, y.inserted);
boost::swap(x.position, y.position);
boost::core::invoke_swap(x.node, y.node);
boost::core::invoke_swap(x.inserted, y.inserted);
boost::core::invoke_swap(x.position, y.position);
}
} // namespace unordered

View File

@ -2327,9 +2327,9 @@ namespace boost {
alloc_ == n.alloc_);
if (value_allocator_traits::propagate_on_container_swap::value ||
!alloc_.has_value() || !n.alloc_.has_value()) {
boost::swap(alloc_, n.alloc_);
boost::core::invoke_swap(alloc_, n.alloc_);
}
boost::swap(ptr_, n.ptr_);
boost::core::invoke_swap(ptr_, n.ptr_);
}
};
@ -2376,9 +2376,9 @@ namespace boost {
void swap(
insert_return_type_set<Iter, NodeType>& x, insert_return_type_set<Iter, NodeType>& y)
{
boost::swap(x.node, y.node);
boost::swap(x.inserted, y.inserted);
boost::swap(x.position, y.position);
boost::core::invoke_swap(x.node, y.node);
boost::core::invoke_swap(x.inserted, y.inserted);
boost::core::invoke_swap(x.position, y.position);
}
} // namespace unordered

View File

@ -18,6 +18,7 @@
#endif
#include "../helpers/check_return_type.hpp"
#include <boost/core/invoke_swap.hpp>
#include <boost/core/pointer_traits.hpp>
#include <boost/limits.hpp>
#include <boost/predef.h>
@ -26,7 +27,6 @@
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/swap.hpp>
typedef long double comparison_type;
@ -165,7 +165,7 @@ template <class X, class T> void container_test(X& r, T const&)
X u5 = rvalue(a_const);
a.swap(b);
boost::swap(a, b);
boost::core::invoke_swap(a, b);
test::check_return_type<X>::equals_ref(r = a);
// Allocator
@ -254,7 +254,7 @@ template <class X> void unordered_destructible_test(X&)
test::check_return_type<const_iterator>::equals(a_const.cend());
a.swap(b);
boost::swap(a, b);
boost::core::invoke_swap(a, b);
test::check_return_type<size_type>::equals(a.size());
test::check_return_type<size_type>::equals(a.max_size());
@ -546,7 +546,7 @@ template <class X, class T> void unordered_unique_test(X& r, T const& t)
test::check_return_type<bool>::equals(insert_return.inserted);
test::check_return_type<iterator>::equals(insert_return.position);
test::check_return_type<node_type>::equals_ref(insert_return.node);
boost::swap(insert_return, insert_return2);
boost::core::invoke_swap(insert_return, insert_return2);
#endif
}

View File

@ -2,6 +2,11 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// temporary #define till all transitive includes comply with
// https://github.com/boostorg/core/commit/5f6fe65
#define BOOST_ALLOW_DEPRECATED_HEADERS
#include "../helpers/unordered.hpp"
#include "../objects/test.hpp"