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) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 62647001..edbee93a 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -21,6 +21,15 @@ #include #endif +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC >= 1400 +#pragma warning(disable:4396) //the inline specifier cannot be used when a + // friend declaration refers to a specialization + // of a function template +#endif +#endif + namespace boost { template @@ -385,8 +394,8 @@ namespace boost friend bool operator==(unordered_map const&, unordered_map const&); friend bool operator!=(unordered_map const&, unordered_map const&); #else - friend bool operator==<>(unordered_map const&, unordered_map const&); - friend bool operator!=<>(unordered_map const&, unordered_map const&); + friend bool operator==(unordered_map const&, unordered_map const&); + friend bool operator!=(unordered_map const&, unordered_map const&); #endif }; // class template unordered_map @@ -757,8 +766,8 @@ namespace boost friend bool operator==(unordered_multimap const&, unordered_multimap const&); friend bool operator!=(unordered_multimap const&, unordered_multimap const&); #else - friend bool operator==<>(unordered_multimap const&, unordered_multimap const&); - friend bool operator!=<>(unordered_multimap const&, unordered_multimap const&); + friend bool operator==(unordered_multimap const&, unordered_multimap const&); + friend bool operator!=(unordered_multimap const&, unordered_multimap const&); #endif }; // class template unordered_multimap @@ -785,4 +794,8 @@ namespace boost } // namespace boost +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + #endif // BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index cfb73ad5..c8d0d1e1 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -21,6 +21,15 @@ #include #endif +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC >= 1400 +#pragma warning(disable:4396) //the inline specifier cannot be used when a + // friend declaration refers to a specialization + // of a function template +#endif +#endif + namespace boost { template @@ -357,8 +366,8 @@ namespace boost friend bool operator==(unordered_set const&, unordered_set const&); friend bool operator!=(unordered_set const&, unordered_set const&); #else - friend bool operator==<>(unordered_set const&, unordered_set const&); - friend bool operator!=<>(unordered_set const&, unordered_set const&); + friend bool operator==(unordered_set const&, unordered_set const&); + friend bool operator!=(unordered_set const&, unordered_set const&); #endif }; // class template unordered_set @@ -714,8 +723,8 @@ namespace boost friend bool operator==(unordered_multiset const&, unordered_multiset const&); friend bool operator!=(unordered_multiset const&, unordered_multiset const&); #else - friend bool operator==<>(unordered_multiset const&, unordered_multiset const&); - friend bool operator!=<>(unordered_multiset const&, unordered_multiset const&); + friend bool operator==(unordered_multiset const&, unordered_multiset const&); + friend bool operator!=(unordered_multiset const&, unordered_multiset const&); #endif }; // class template unordered_multiset @@ -742,4 +751,8 @@ namespace boost } // namespace boost +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + #endif // BOOST_UNORDERED_UNORDERED_SET_HPP_INCLUDED