Merged revisions 49661-49662,49666,49669,49735,49756,49770,49811 via svnmerge from

https://svn.boost.org/svn/boost/trunk

........
  r49661 | danieljames | 2008-11-09 12:03:45 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Move hash detail headers out of boost/functional/detail.
........
  r49662 | danieljames | 2008-11-09 12:11:50 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Add a forwarding header for container_fwd.hpp
........
  r49666 | danieljames | 2008-11-09 19:12:05 +0000 (Sun, 09 Nov 2008) | 1 line
  
  Avoid comparing default initialised iterators in position_iterator.
........
  r49669 | danieljames | 2008-11-09 21:57:38 +0000 (Sun, 09 Nov 2008) | 2 lines
  
  Add link to the header to the synopsis in reference documentation.
  Refs #2214
........
  r49735 | danieljames | 2008-11-14 12:51:00 +0000 (Fri, 14 Nov 2008) | 1 line
  
  Explicitly specify the template parameters in the unordered container friend, in order to avoid some warnings.
........
  r49756 | danieljames | 2008-11-14 16:11:16 +0000 (Fri, 14 Nov 2008) | 1 line
  
  Use pragmas to suppress a Visual C++ warning.
........
  r49770 | danieljames | 2008-11-15 13:07:29 +0000 (Sat, 15 Nov 2008) | 1 line
  
  Use the new swap library.
........
  r49811 | danieljames | 2008-11-16 23:10:00 +0000 (Sun, 16 Nov 2008) | 1 line
  
  Fix a typo.
........


[SVN r49855]
This commit is contained in:
Daniel James
2008-11-20 22:53:20 +00:00
parent 89ab17cce5
commit 07e715fceb
5 changed files with 45 additions and 25 deletions

View File

@ -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]

View File

@ -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)()) ?

View File

@ -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)

View File

@ -21,6 +21,15 @@
#include <boost/unordered/detail/move.hpp>
#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 <class Key, class T, class Hash, class Pred, class Alloc>
@ -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==<Key, T, Hash, Pred, Alloc>(unordered_map const&, unordered_map const&);
friend bool operator!=<Key, T, Hash, Pred, Alloc>(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==<Key, T, Hash, Pred, Alloc>(unordered_multimap const&, unordered_multimap const&);
friend bool operator!=<Key, T, Hash, Pred, Alloc>(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

View File

@ -21,6 +21,15 @@
#include <boost/unordered/detail/move.hpp>
#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 <class Value, class Hash, class Pred, class Alloc>
@ -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==<Value, Hash, Pred, Alloc>(unordered_set const&, unordered_set const&);
friend bool operator!=<Value, Hash, Pred, Alloc>(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==<Value, Hash, Pred, Alloc>(unordered_multiset const&, unordered_multiset const&);
friend bool operator!=<Value, Hash, Pred, Alloc>(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