|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r49770 - in trunk: boost/unordered/detail libs/unordered/doc
From: daniel_james_at_[hidden]
Date: 2008-11-15 08:07:30
Author: danieljames
Date: 2008-11-15 08:07:29 EST (Sat, 15 Nov 2008)
New Revision: 49770
URL: http://svn.boost.org/trac/boost/changeset/49770
Log:
Use the new swap library.
Text files modified:
trunk/boost/unordered/detail/hash_table.hpp | 12 +-----------
trunk/boost/unordered/detail/hash_table_impl.hpp | 12 ++++++------
trunk/libs/unordered/doc/changes.qbk | 4 ++++
3 files changed, 11 insertions(+), 17 deletions(-)
Modified: trunk/boost/unordered/detail/hash_table.hpp
==============================================================================
--- trunk/boost/unordered/detail/hash_table.hpp (original)
+++ trunk/boost/unordered/detail/hash_table.hpp 2008-11-15 08:07:29 EST (Sat, 15 Nov 2008)
@@ -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 @@
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)()) ?
Modified: trunk/boost/unordered/detail/hash_table_impl.hpp
==============================================================================
--- trunk/boost/unordered/detail/hash_table_impl.hpp (original)
+++ trunk/boost/unordered/detail/hash_table_impl.hpp 2008-11-15 08:07:29 EST (Sat, 15 Nov 2008)
@@ -143,8 +143,8 @@
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 @@
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)
Modified: trunk/libs/unordered/doc/changes.qbk
==============================================================================
--- trunk/libs/unordered/doc/changes.qbk (original)
+++ trunk/libs/unordered/doc/changes.qbk 2008-11-15 08:07:29 EST (Sat, 15 Nov 2008)
@@ -42,4 +42,8 @@
* 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]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk