diff --git a/doc/changes.qbk b/doc/changes.qbk index b55a5170..8b2bd44c 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -42,4 +42,8 @@ First official release. * Move all the implementation inside `boost/unordered`, to assist modularization and hopefully make it easier to track changes in subversion. +[h2 Boost 1.38.0] + +* Use [@../../libs/utility/swap.html `boost::swap`]. + [endsect] diff --git a/include/boost/unordered/detail/hash_table.hpp b/include/boost/unordered/detail/hash_table.hpp index 88e61d13..7e649a3f 100644 --- a/include/boost/unordered/detail/hash_table.hpp +++ b/include/boost/unordered/detail/hash_table.hpp @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -58,17 +59,6 @@ namespace boost { static const std::size_t default_initial_bucket_count = 50; static const float minimum_max_load_factor = 1e-3f; - template - inline void hash_swap(T& x, T& y) - { -#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) - std::swap(x,y); -#else - using std::swap; - swap(x, y); -#endif - } - inline std::size_t double_to_size_t(double f) { return f >= static_cast((std::numeric_limits::max)()) ? diff --git a/include/boost/unordered/detail/hash_table_impl.hpp b/include/boost/unordered/detail/hash_table_impl.hpp index e78962fb..a75d30d5 100644 --- a/include/boost/unordered/detail/hash_table_impl.hpp +++ b/include/boost/unordered/detail/hash_table_impl.hpp @@ -143,8 +143,8 @@ namespace boost { void swap(allocators& x) { - unordered_detail::hash_swap(node_alloc_, x.node_alloc_); - unordered_detail::hash_swap(bucket_alloc_, x.bucket_alloc_); + boost::swap(node_alloc_, x.node_alloc_); + boost::swap(bucket_alloc_, x.bucket_alloc_); } bool operator==(allocators const& x) @@ -238,10 +238,10 @@ namespace boost { void swap(allocators& x) { - unordered_detail::hash_swap(node_alloc_, x.node_alloc_); - unordered_detail::hash_swap(bucket_alloc_, x.bucket_alloc_); - unordered_detail::hash_swap(value_alloc_, x.value_alloc_); - unordered_detail::hash_swap(node_base_alloc_, x.node_base_alloc_); + boost::swap(node_alloc_, x.node_alloc_); + boost::swap(bucket_alloc_, x.bucket_alloc_); + boost::swap(value_alloc_, x.value_alloc_); + boost::swap(node_base_alloc_, x.node_base_alloc_); } bool operator==(allocators const& x)