From ca2a46f290b28eec6672292fbf347f6d192c5a1c Mon Sep 17 00:00:00 2001 From: joaquintides Date: Fri, 25 Aug 2023 19:45:16 +0200 Subject: [PATCH] complied with https://github.com/boostorg/core/commit/5f6fe65 --- include/boost/unordered/detail/fca.hpp | 4 ++-- include/boost/unordered/detail/implementation.hpp | 12 ++++++------ include/boost/unordered/unordered_map.hpp | 10 +++++----- include/boost/unordered/unordered_set.hpp | 10 +++++----- test/unordered/compile_tests.hpp | 8 ++++---- test/unordered/serialization_tests.cpp | 5 +++++ 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/include/boost/unordered/detail/fca.hpp b/include/boost/unordered/detail/fca.hpp index b2012f15..2a4167dc 100644 --- a/include/boost/unordered/detail/fca.hpp +++ b/include/boost/unordered/detail/fca.hpp @@ -120,12 +120,12 @@ to normal separate chaining implementations. #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -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()); } } diff --git a/include/boost/unordered/detail/implementation.hpp b/include/boost/unordered/detail/implementation.hpp index f94caa65..f353365c 100644 --- a/include/boost/unordered/detail/implementation.hpp +++ b/include/boost/unordered/detail/implementation.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -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()); diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index b60acb75..2a707c49 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -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& x, insert_return_type_map& 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 diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 7ebba5a9..49bcf1ea 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -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& x, insert_return_type_set& 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 diff --git a/test/unordered/compile_tests.hpp b/test/unordered/compile_tests.hpp index 16d11f49..b2c00a54 100644 --- a/test/unordered/compile_tests.hpp +++ b/test/unordered/compile_tests.hpp @@ -18,6 +18,7 @@ #endif #include "../helpers/check_return_type.hpp" +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include typedef long double comparison_type; @@ -165,7 +165,7 @@ template 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::equals_ref(r = a); // Allocator @@ -254,7 +254,7 @@ template void unordered_destructible_test(X&) test::check_return_type::equals(a_const.cend()); a.swap(b); - boost::swap(a, b); + boost::core::invoke_swap(a, b); test::check_return_type::equals(a.size()); test::check_return_type::equals(a.max_size()); @@ -546,7 +546,7 @@ template void unordered_unique_test(X& r, T const& t) test::check_return_type::equals(insert_return.inserted); test::check_return_type::equals(insert_return.position); test::check_return_type::equals_ref(insert_return.node); - boost::swap(insert_return, insert_return2); + boost::core::invoke_swap(insert_return, insert_return2); #endif } diff --git a/test/unordered/serialization_tests.cpp b/test/unordered/serialization_tests.cpp index 4bb32f06..c1b3fc7b 100644 --- a/test/unordered/serialization_tests.cpp +++ b/test/unordered/serialization_tests.cpp @@ -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"