forked from boostorg/unordered
Use the new swap library.
[SVN r49770]
This commit is contained in:
@ -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]
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
|
||||
#include <boost/mpl/aux_/config/eti.hpp>
|
||||
|
||||
@ -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 <class T>
|
||||
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<double>((std::numeric_limits<std::size_t>::max)()) ?
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user