Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79545 - in branches/release: . boost boost/unordered boost/unordered/detail libs libs/unordered libs/unordered/test/exception libs/unordered/test/helpers libs/unordered/test/objects libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2012-07-15 19:44:44


Author: danieljames
Date: 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
New Revision: 79545
URL: http://svn.boost.org/trac/boost/changeset/79545

Log:
Unordered: Merge some of the older changes from trunk.

Code reorganization, simpler tests, better use of Boost.Move.

Added:
   branches/release/boost/unordered/detail/allocate.hpp
      - copied, changed from r79163, /trunk/boost/unordered/detail/allocate.hpp
Removed:
   branches/release/boost/unordered/detail/allocator_helpers.hpp
   branches/release/boost/unordered/detail/emplace_args.hpp
   branches/release/libs/unordered/test/helpers/allocator.hpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/unordered/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/unordered/ (props changed)
Text files modified:
   branches/release/boost/unordered/detail/allocate.hpp | 19 +++----
   branches/release/boost/unordered/detail/buckets.hpp | 12 +---
   branches/release/boost/unordered/detail/equivalent.hpp | 9 +++
   branches/release/boost/unordered/detail/extract_key.hpp | 10 ++--
   branches/release/boost/unordered/detail/unique.hpp | 29 ++++++-----
   branches/release/boost/unordered/unordered_map.hpp | 13 ++--
   branches/release/boost/unordered/unordered_set.hpp | 13 ++--
   branches/release/libs/unordered/test/exception/insert_exception_tests.cpp | 14 ++--
   branches/release/libs/unordered/test/helpers/check_return_type.hpp | 8 +-
   branches/release/libs/unordered/test/helpers/count.hpp | 24 +++------
   branches/release/libs/unordered/test/helpers/invariants.hpp | 6 --
   branches/release/libs/unordered/test/helpers/memory.hpp | 58 ++---------------------
   branches/release/libs/unordered/test/helpers/metafunctions.hpp | 57 +++--------------------
   branches/release/libs/unordered/test/helpers/random_values.hpp | 10 ++-
   branches/release/libs/unordered/test/helpers/strong.hpp | 1
   branches/release/libs/unordered/test/helpers/tracker.hpp | 96 ++++++++++++++++-----------------------
   branches/release/libs/unordered/test/objects/cxx11_allocator.hpp | 24 ++++++++-
   branches/release/libs/unordered/test/objects/exception.hpp | 35 +++++---------
   branches/release/libs/unordered/test/objects/minimal.hpp | 8 +-
   branches/release/libs/unordered/test/objects/test.hpp | 8 +-
   branches/release/libs/unordered/test/unordered/Jamfile.v2 | 3 -
   branches/release/libs/unordered/test/unordered/allocator_traits.cpp | 52 ++++++++++----------
   branches/release/libs/unordered/test/unordered/compile_tests.hpp | 79 +++++++++++++++-----------------
   branches/release/libs/unordered/test/unordered/incomplete_test.cpp | 58 ++++++++++++-----------
   branches/release/libs/unordered/test/unordered/minimal_allocator.cpp | 24 +++++-----
   branches/release/libs/unordered/test/unordered/move_tests.cpp | 4
   branches/release/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 19 -------
   27 files changed, 284 insertions(+), 409 deletions(-)

Copied: branches/release/boost/unordered/detail/allocate.hpp (from r79163, /trunk/boost/unordered/detail/allocate.hpp)
==============================================================================
--- /trunk/boost/unordered/detail/allocate.hpp (original)
+++ branches/release/boost/unordered/detail/allocate.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -91,6 +91,10 @@
 #define BOOST_UNORDERED_EMPLACE_ARGS BOOST_FWD_REF(Args)... args
 #define BOOST_UNORDERED_EMPLACE_FORWARD boost::forward<Args>(args)...
 
+#define BOOST_UNORDERED_EMPLACE_ARGS1(a0) a0
+#define BOOST_UNORDERED_EMPLACE_ARGS2(a0, a1) a0, a1
+#define BOOST_UNORDERED_EMPLACE_ARGS3(a0, a1, a2) a0, a1, a2
+
 #else
 
 #define BOOST_UNORDERED_EMPLACE_TEMPLATE typename Args
@@ -128,6 +132,10 @@
         return e; \
     }
 
+#define BOOST_UNORDERED_EMPLACE_ARGS1 create_emplace_args
+#define BOOST_UNORDERED_EMPLACE_ARGS2 create_emplace_args
+#define BOOST_UNORDERED_EMPLACE_ARGS3 create_emplace_args
+
 #if defined(BOOST_NO_RVALUE_REFERENCES)
 
 #define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
@@ -496,17 +504,6 @@
 #endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
 #endif // BOOST_NO_VARIADIC_TEMPLATES
 
- ////////////////////////////////////////////////////////////////////////////
- // Construct without using the emplace args mechanism.
-
- template <typename T, typename A0>
- inline void construct_impl2(T* address, BOOST_FWD_REF(A0) a0)
- {
- new((void*) address) T(
- boost::forward<A0>(a0)
- );
- }
-
 }}}
 
 ////////////////////////////////////////////////////////////////////////////////

Deleted: branches/release/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- branches/release/boost/unordered/detail/allocator_helpers.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
+++ (empty file)
@@ -1,723 +0,0 @@
-
-// Copyright 2005-2011 Daniel James.
-// Copyright 2009 Pablo Halpern.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// Allocator traits written by Daniel James based on Pablo Halpern's
-// implementation.
-
-#ifndef BOOST_UNORDERED_DETAIL_ALLOCATOR_UTILITIES_HPP_INCLUDED
-#define BOOST_UNORDERED_DETAIL_ALLOCATOR_UTILITIES_HPP_INCLUDED
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <boost/unordered/detail/emplace_args.hpp>
-#include <boost/assert.hpp>
-#include <boost/utility/addressof.hpp>
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Pick which version of allocator_traits to use
-//
-// 0 = Own partial implementation
-// 1 = std::allocator_traits
-// 2 = boost::container::allocator_traits
-
-#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
-# if defined(__GXX_EXPERIMENTAL_CXX0X__) && \
- (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 1
-# elif defined(BOOST_MSVC)
-# if BOOST_MSVC < 1400
- // Use container's allocator_traits for older versions of Visual
- // C++ as I don't test with them.
-# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 2
-# endif
-# endif
-#endif
-
-#if !defined(BOOST_UNORDERED_USE_ALLOCATOR_TRAITS)
-# define BOOST_UNORDERED_USE_ALLOCATOR_TRAITS 0
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Some utilities for implementing allocator_traits, but useful elsewhere so
-// they're always defined.
-
-#if !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
-# include <type_traits>
-#endif
-
-namespace boost { namespace unordered { namespace detail {
-
- ////////////////////////////////////////////////////////////////////////////
- // Integral_constrant, true_type, false_type
- //
- // Uses the standard versions if available.
-
-#if !defined(BOOST_NO_0X_HDR_TYPE_TRAITS)
-
- using std::integral_constant;
- using std::true_type;
- using std::false_type;
-
-#else
-
- template <typename T, T Value>
- struct integral_constant { enum { value = Value }; };
-
- typedef boost::unordered::detail::integral_constant<bool, true> true_type;
- typedef boost::unordered::detail::integral_constant<bool, false> false_type;
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Explicitly call a destructor
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4100) // unreferenced formal parameter
-#endif
-
- template <class T>
- inline void destroy(T* x) {
- x->~T();
- }
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Expression test mechanism
- //
- // When SFINAE expressions are available, define
- // BOOST_UNORDERED_HAS_FUNCTION which can check if a function call is
- // supported by a class, otherwise define BOOST_UNORDERED_HAS_MEMBER which
- // can detect if a class has the specified member, but not that it has the
- // correct type, this is good enough for a passable impression of
- // allocator_traits.
-
-#if !defined(BOOST_NO_SFINAE_EXPR)
-
- template <typename T, unsigned int> struct expr_test;
- template <typename T> struct expr_test<T, sizeof(char)> : T {};
- template <typename U> static char for_expr_test(U const&);
-
-# define BOOST_UNORDERED_CHECK_EXPRESSION(count, result, expression) \
- template <typename U> \
- static typename boost::unordered::detail::expr_test< \
- BOOST_PP_CAT(choice, result), \
- sizeof(boost::unordered::detail::for_expr_test(( \
- (expression), \
- 0)))>::type test( \
- BOOST_PP_CAT(choice, count))
-
-# define BOOST_UNORDERED_DEFAULT_EXPRESSION(count, result) \
- template <typename U> \
- static BOOST_PP_CAT(choice, result)::type test( \
- BOOST_PP_CAT(choice, count))
-
-# define BOOST_UNORDERED_HAS_FUNCTION(name, thing, args, _) \
- struct BOOST_PP_CAT(has_, name) \
- { \
- BOOST_UNORDERED_CHECK_EXPRESSION(1, 1, \
- boost::unordered::detail::make< thing >().name args); \
- BOOST_UNORDERED_DEFAULT_EXPRESSION(2, 2); \
- \
- enum { value = sizeof(test<T>(choose())) == sizeof(choice1::type) };\
- }
-
-#else
-
- template <typename T> struct identity { typedef T type; };
-
-# define BOOST_UNORDERED_CHECK_MEMBER(count, result, name, member) \
- \
- typedef typename boost::unordered::detail::identity<member>::type \
- BOOST_PP_CAT(check, count); \
- \
- template <BOOST_PP_CAT(check, count) e> \
- struct BOOST_PP_CAT(test, count) { \
- typedef BOOST_PP_CAT(choice, result) type; \
- }; \
- \
- template <class U> static typename \
- BOOST_PP_CAT(test, count)<&U::name>::type \
- test(BOOST_PP_CAT(choice, count))
-
-# define BOOST_UNORDERED_DEFAULT_MEMBER(count, result) \
- template <class U> static BOOST_PP_CAT(choice, result)::type \
- test(BOOST_PP_CAT(choice, count))
-
-# define BOOST_UNORDERED_HAS_MEMBER(name) \
- struct BOOST_PP_CAT(has_, name) \
- { \
- struct impl { \
- struct base_mixin { int name; }; \
- struct base : public T, public base_mixin {}; \
- \
- BOOST_UNORDERED_CHECK_MEMBER(1, 1, name, int base_mixin::*); \
- BOOST_UNORDERED_DEFAULT_MEMBER(2, 2); \
- \
- enum { value = sizeof(choice2::type) == \
- sizeof(test<base>(choose())) \
- }; \
- }; \
- \
- enum { value = impl::value }; \
- }
-
-#endif
-
-}}}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Allocator traits
-//
-// First our implementation, then later light wrappers around the alternatives
-
-#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 0
-
-# include <boost/limits.hpp>
-# include <boost/utility/enable_if.hpp>
-# include <boost/pointer_to_other.hpp>
-# if defined(BOOST_NO_SFINAE_EXPR)
-# include <boost/type_traits/is_same.hpp>
-# endif
-
-# if defined(BOOST_UNORDERED_VARIADIC_MOVE) && \
- !defined(BOOST_NO_SFINAE_EXPR)
-# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 1
-# else
-# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 0
-# endif
-
-namespace boost { namespace unordered { namespace detail {
-
- // TODO: Does this match std::allocator_traits<Alloc>::rebind_alloc<T>?
- template <typename Alloc, typename T>
- struct rebind_wrap
- {
- typedef typename Alloc::BOOST_NESTED_TEMPLATE rebind<T>::other type;
- };
-
-# if defined(BOOST_MSVC) && BOOST_MSVC <= 1400
-
-# define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
- template <typename Tp, typename Default> \
- struct default_type_ ## tname { \
- \
- template <typename X> \
- static choice1::type test(choice1, typename X::tname* = 0); \
- \
- template <typename X> \
- static choice2::type test(choice2, void* = 0); \
- \
- struct DefaultWrap { typedef Default tname; }; \
- \
- enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
- \
- typedef typename boost::detail::if_true<value>:: \
- BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
- ::type::tname type; \
- }
-
-# else
-
- template <typename T, typename T2>
- struct sfinae : T2 {};
-
-# define BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(tname) \
- template <typename Tp, typename Default> \
- struct default_type_ ## tname { \
- \
- template <typename X> \
- static typename boost::unordered::detail::sfinae< \
- typename X::tname, choice1>::type \
- test(choice1); \
- \
- template <typename X> \
- static choice2::type test(choice2); \
- \
- struct DefaultWrap { typedef Default tname; }; \
- \
- enum { value = (1 == sizeof(test<Tp>(choose()))) }; \
- \
- typedef typename boost::detail::if_true<value>:: \
- BOOST_NESTED_TEMPLATE then<Tp, DefaultWrap> \
- ::type::tname type; \
- }
-
-# endif
-
-# define BOOST_UNORDERED_DEFAULT_TYPE(T,tname, arg) \
- typename default_type_ ## tname<T, arg>::type
-
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(void_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(const_void_pointer);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(difference_type);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(size_type);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_copy_assignment);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment);
- BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_swap);
-
-# if !defined(BOOST_NO_SFINAE_EXPR)
-
- template <typename T>
- BOOST_UNORDERED_HAS_FUNCTION(
- select_on_container_copy_construction, U const, (), 0
- );
-
- template <typename T>
- BOOST_UNORDERED_HAS_FUNCTION(
- max_size, U const, (), 0
- );
-
-# if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-
- template <typename T, typename ValueType, typename... Args>
- BOOST_UNORDERED_HAS_FUNCTION(
- construct, U, (
- boost::unordered::detail::make<ValueType*>(),
- boost::unordered::detail::make<Args const>()...), 2
- );
-
-# else
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_FUNCTION(
- construct, U, (
- boost::unordered::detail::make<ValueType*>(),
- boost::unordered::detail::make<ValueType const>()), 2
- );
-
-# endif
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_FUNCTION(
- destroy, U, (boost::unordered::detail::make<ValueType*>()), 1
- );
-
-# else
-
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(select_on_container_copy_construction);
-
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(max_size);
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_MEMBER(construct);
-
- template <typename T, typename ValueType>
- BOOST_UNORDERED_HAS_MEMBER(destroy);
-
-# endif
-
- template <typename Alloc>
- inline typename boost::enable_if_c<
- boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
- {
- return rhs.select_on_container_copy_construction();
- }
-
- template <typename Alloc>
- inline typename boost::disable_if_c<
- boost::unordered::detail::
- has_select_on_container_copy_construction<Alloc>::value, Alloc
- >::type call_select_on_container_copy_construction(const Alloc& rhs)
- {
- return rhs;
- }
-
- template <typename SizeType, typename Alloc>
- inline typename boost::enable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc& a)
- {
- return a.max_size();
- }
-
- template <typename SizeType, typename Alloc>
- inline typename boost::disable_if_c<
- boost::unordered::detail::has_max_size<Alloc>::value, SizeType
- >::type call_max_size(const Alloc&)
- {
- return (std::numeric_limits<SizeType>::max)();
- }
-
- template <typename Alloc>
- struct allocator_traits
- {
- typedef Alloc allocator_type;
- typedef typename Alloc::value_type value_type;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, pointer, value_type*)
- pointer;
-
- template <typename T>
- struct pointer_to_other : boost::pointer_to_other<pointer, T> {};
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_pointer,
- typename pointer_to_other<const value_type>::type)
- const_pointer;
-
- //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, void_pointer,
- // typename pointer_to_other<void>::type)
- // void_pointer;
- //
- //typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, const_void_pointer,
- // typename pointer_to_other<const void>::type)
- // const_void_pointer;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, difference_type,
- std::ptrdiff_t) difference_type;
-
- typedef BOOST_UNORDERED_DEFAULT_TYPE(Alloc, size_type, std::size_t)
- size_type;
-
- // TODO: rebind_alloc and rebind_traits
-
- static pointer allocate(Alloc& a, size_type n)
- { return a.allocate(n); }
-
- // I never use this, so I'll just comment it out for now.
- //
- //static pointer allocate(Alloc& a, size_type n,
- // const_void_pointer hint)
- // { return DEFAULT_FUNC(allocate, pointer)(a, n, hint); }
-
- static void deallocate(Alloc& a, pointer p, size_type n)
- { a.deallocate(p, n); }
-
- public:
-
-# if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
-
- template <typename T, typename... Args>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_construct<Alloc, T, Args...>
- ::value>::type
- construct(Alloc& a, T* p, Args&&... x)
- {
- a.construct(p, boost::forward<Args>(x)...);
- }
-
- template <typename T, typename... Args>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_construct<Alloc, T, Args...>
- ::value>::type
- construct(Alloc&, T* p, Args&&... x)
- {
- new ((void*) p) T(boost::forward<Args>(x)...);
- }
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc& a, T* p)
- {
- a.destroy(p);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc&, T* p)
- {
- boost::unordered::detail::destroy(p);
- }
-
-# elif !defined(BOOST_NO_SFINAE_EXPR)
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value>::type
- construct(Alloc& a, T* p, T const& x)
- {
- a.construct(p, x);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value>::type
- construct(Alloc&, T* p, T const& x)
- {
- new ((void*) p) T(x);
- }
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc& a, T* p)
- {
- a.destroy(p);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value>::type
- destroy(Alloc&, T* p)
- {
- boost::unordered::detail::destroy(p);
- }
-
-# else
-
- // If we don't have SFINAE expressions, only call construct for the
- // copy constructor for the allocator's value_type - as that's
- // the only construct method that old fashioned allocators support.
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- construct(Alloc& a, T* p, T const& x)
- {
- a.construct(p, x);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_construct<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- construct(Alloc&, T* p, T const& x)
- {
- new ((void*) p) T(x);
- }
-
- template <typename T>
- static typename boost::enable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- destroy(Alloc& a, T* p)
- {
- a.destroy(p);
- }
-
- template <typename T>
- static typename boost::disable_if_c<
- boost::unordered::detail::has_destroy<Alloc, T>::value &&
- boost::is_same<T, value_type>::value
- >::type
- destroy(Alloc&, T* p)
- {
- boost::unordered::detail::destroy(p);
- }
-
-# endif
-
- static size_type max_size(const Alloc& a)
- {
- return boost::unordered::detail::call_max_size<size_type>(a);
- }
-
- // Allocator propagation on construction
-
- static Alloc select_on_container_copy_construction(Alloc const& rhs)
- {
- return boost::unordered::detail::
- call_select_on_container_copy_construction(rhs);
- }
-
- // Allocator propagation on assignment and swap.
- // Return true if lhs is modified.
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc, propagate_on_container_copy_assignment, false_type)
- propagate_on_container_copy_assignment;
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc,propagate_on_container_move_assignment, false_type)
- propagate_on_container_move_assignment;
- typedef BOOST_UNORDERED_DEFAULT_TYPE(
- Alloc,propagate_on_container_swap,false_type)
- propagate_on_container_swap;
- };
-}}}
-
-# undef BOOST_UNORDERED_DEFAULT_TYPE_TMPLT
-# undef BOOST_UNORDERED_DEFAULT_TYPE
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// std::allocator_traits
-
-#elif BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1
-
-# include <memory>
-
-# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 1
-
-namespace boost { namespace unordered { namespace detail {
-
- template <typename Alloc>
- struct allocator_traits : std::allocator_traits<Alloc> {};
-
- template <typename Alloc, typename T>
- struct rebind_wrap
- {
- typedef typename std::allocator_traits<Alloc>::
- template rebind_alloc<T> type;
- };
-}}}
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// boost::container::allocator_traits
-
-#elif BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 2
-
-# include <boost/container/allocator_traits.hpp>
-
-# define BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT 0
-
-namespace boost { namespace unordered { namespace detail {
-
- template <typename Alloc>
- struct allocator_traits :
- boost::container::allocator_traits<Alloc> {};
-
- template <typename Alloc, typename T>
- struct rebind_wrap :
- boost::container::allocator_traits<Alloc>::
- template portable_rebind_alloc<T>
- {};
-
-}}}
-
-#else
-
-#error "Invalid BOOST_UNORDERED_USE_ALLOCATOR_TRAITS value."
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Some helper functions for allocating & constructing
-
-namespace boost { namespace unordered { namespace detail {
-
- ////////////////////////////////////////////////////////////////////////////
- //
- // construct_node/destroy_node
- //
- // Construct a node using the best available method.
-
-#if BOOST_UNORDERED_DETAIL_FULL_CONSTRUCT
-
- template <typename Alloc, typename T, BOOST_UNORDERED_EMPLACE_TEMPLATE>
- inline void construct_node(Alloc& a, T* p, BOOST_UNORDERED_EMPLACE_ARGS)
- {
- boost::unordered::detail::allocator_traits<Alloc>::construct(
- a, p, BOOST_UNORDERED_EMPLACE_FORWARD);
- }
-
- template <typename Alloc, typename T>
- inline void destroy_node(Alloc& a, T* p)
- {
- boost::unordered::detail::allocator_traits<Alloc>::destroy(a, p);
- }
-
-#else
-
- template <typename Alloc, typename T, BOOST_UNORDERED_EMPLACE_TEMPLATE>
- inline void construct_node(Alloc& a, T* p, BOOST_UNORDERED_EMPLACE_ARGS)
- {
- boost::unordered::detail::allocator_traits<Alloc>::construct(a, p, T());
- try {
- boost::unordered::detail::construct_impl(
- p->value_ptr(), BOOST_UNORDERED_EMPLACE_FORWARD);
- } catch(...) {
- boost::unordered::detail::allocator_traits<Alloc>::destroy(a, p);
- throw;
- }
- }
-
- template <typename Alloc, typename T>
- inline void destroy_node(Alloc& a, T* p)
- {
- boost::unordered::detail::destroy(p->value_ptr());
- boost::unordered::detail::allocator_traits<Alloc>::destroy(a, p);
- }
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- //
- // array_constructor
- //
- // Allocate and construct an array in an exception safe manner, and
- // clean up if an exception is thrown before the container takes charge
- // of it.
-
- template <typename Allocator>
- struct array_constructor
- {
- typedef boost::unordered::detail::allocator_traits<Allocator> traits;
- typedef typename traits::pointer pointer;
-
- Allocator& alloc_;
- pointer ptr_;
- pointer constructed_;
- std::size_t length_;
-
- array_constructor(Allocator& a)
- : alloc_(a), ptr_(), constructed_(), length_(0)
- {
- constructed_ = pointer();
- ptr_ = pointer();
- }
-
- ~array_constructor() {
- if (ptr_) {
- for(pointer p = ptr_; p != constructed_; ++p)
- traits::destroy(alloc_, boost::addressof(*p));
-
- traits::deallocate(alloc_, ptr_, length_);
- }
- }
-
- template <typename V>
- void construct(V const& v, std::size_t l)
- {
- BOOST_ASSERT(!ptr_);
- length_ = l;
- ptr_ = traits::allocate(alloc_, length_);
- pointer end = ptr_ + static_cast<std::ptrdiff_t>(length_);
- for(constructed_ = ptr_; constructed_ != end; ++constructed_)
- traits::construct(alloc_, boost::addressof(*constructed_), v);
- }
-
- pointer get() const
- {
- return ptr_;
- }
-
- pointer release()
- {
- pointer p(ptr_);
- ptr_ = pointer();
- return p;
- }
-
- private:
-
- array_constructor(array_constructor const&);
- array_constructor& operator=(array_constructor const&);
- };
-}}}
-
-#endif

Modified: branches/release/boost/unordered/detail/buckets.hpp
==============================================================================
--- branches/release/boost/unordered/detail/buckets.hpp (original)
+++ branches/release/boost/unordered/detail/buckets.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -12,7 +12,7 @@
 #endif
 
 #include <boost/unordered/detail/util.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
+#include <boost/unordered/detail/allocate.hpp>
 #include <boost/type_traits/aligned_storage.hpp>
 #include <boost/type_traits/alignment_of.hpp>
 #include <boost/swap.hpp>
@@ -82,15 +82,11 @@
         void construct_value2(BOOST_FWD_REF(A0) a0)
         {
             BOOST_ASSERT(node_ && !constructed_);
-# if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- boost::unordered::detail::construct_node(alloc_,
- boost::addressof(*node_), boost::forward<A0>(a0));
-# else
+
             boost::unordered::detail::construct_node(alloc_,
                 boost::addressof(*node_),
- boost::unordered::detail::create_emplace_args(
- boost::forward<A0>(a0)));
-# endif
+ BOOST_UNORDERED_EMPLACE_ARGS1(boost::forward<A0>(a0)));
+
             constructed_ = true;
             node_->init(static_cast<typename node::link_pointer>(node_));
         }

Deleted: branches/release/boost/unordered/detail/emplace_args.hpp
==============================================================================
--- branches/release/boost/unordered/detail/emplace_args.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
+++ (empty file)
@@ -1,518 +0,0 @@
-
-// Copyright (C) 2011 Daniel James.
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See http://www.boost.org/libs/unordered for documentation
-
-#ifndef BOOST_UNORDERED_EMPLACE_ARGS_HPP
-#define BOOST_UNORDERED_EMPLACE_ARGS_HPP
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <boost/unordered/detail/fwd.hpp>
-#include <boost/move/move.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/inc.hpp>
-#include <boost/preprocessor/dec.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/add_lvalue_reference.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/detail/select_type.hpp>
-#include <utility>
-
-#if !defined(BOOST_NO_0X_HDR_TUPLE)
-#include <tuple>
-#endif
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4512) // assignment operator could not be generated.
-#pragma warning(disable:4345) // behavior change: an object of POD type
- // constructed with an initializer of the form ()
- // will be default-initialized.
-#endif
-
-#define BOOST_UNORDERED_EMPLACE_LIMIT 10
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES) && \
- !defined(BOOST_NO_VARIADIC_TEMPLATES)
-#define BOOST_UNORDERED_VARIADIC_MOVE
-#endif
-
-namespace boost { namespace unordered { namespace detail {
-
- ////////////////////////////////////////////////////////////////////////////
- // Bits and pieces for implementing traits
-
- template <typename T> typename boost::add_lvalue_reference<T>::type make();
- struct choice9 { typedef char (&type)[9]; };
- struct choice8 : choice9 { typedef char (&type)[8]; };
- struct choice7 : choice8 { typedef char (&type)[7]; };
- struct choice6 : choice7 { typedef char (&type)[6]; };
- struct choice5 : choice6 { typedef char (&type)[5]; };
- struct choice4 : choice5 { typedef char (&type)[4]; };
- struct choice3 : choice4 { typedef char (&type)[3]; };
- struct choice2 : choice3 { typedef char (&type)[2]; };
- struct choice1 : choice2 { typedef char (&type)[1]; };
- choice1 choose();
-
- typedef choice1::type yes_type;
- typedef choice2::type no_type;
-
- struct private_type
- {
- private_type const &operator,(int) const;
- };
-
- template <typename T>
- no_type is_private_type(T const&);
- yes_type is_private_type(private_type const&);
-
- struct convert_from_anything {
- template <typename T>
- convert_from_anything(T const&);
- };
-
- ////////////////////////////////////////////////////////////////////////////
- // emplace_args
- //
- // Either forwarding variadic arguments, or storing the arguments in
- // emplace_args##n
-
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-
-#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename... Args
-#define BOOST_UNORDERED_EMPLACE_ARGS Args&&... args
-#define BOOST_UNORDERED_EMPLACE_FORWARD boost::forward<Args>(args)...
-
-#else
-
-#define BOOST_UNORDERED_EMPLACE_TEMPLATE typename Args
-#define BOOST_UNORDERED_EMPLACE_ARGS Args const& args
-#define BOOST_UNORDERED_EMPLACE_FORWARD args
-
-#define BOOST_UNORDERED_FWD_PARAM(z, n, a) \
- BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(a, n)
-
-#define BOOST_UNORDERED_CALL_FORWARD(z, i, a) \
- boost::forward<BOOST_PP_CAT(A,i)>(BOOST_PP_CAT(a,i))
-
-#define BOOST_UNORDERED_EARGS(z, n, _) \
- template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- struct BOOST_PP_CAT(emplace_args, n) \
- { \
- BOOST_PP_REPEAT_##z(n, BOOST_UNORDERED_EARGS_MEMBER, _) \
- BOOST_PP_CAT(emplace_args, n) ( \
- BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, Arg, b) \
- ) : BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_EARGS_INIT, _) \
- {} \
- \
- }; \
- \
- template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- inline BOOST_PP_CAT(emplace_args, n) < \
- BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
- > create_emplace_args( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, b) \
- ) \
- { \
- BOOST_PP_CAT(emplace_args, n) < \
- BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
- > e(BOOST_PP_ENUM_PARAMS_Z(z, n, b)); \
- return e; \
- }
-
-#if defined(BOOST_NO_RVALUE_REFERENCES)
-
-#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
- typedef BOOST_FWD_REF(BOOST_PP_CAT(A, n)) BOOST_PP_CAT(Arg, n); \
- BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
-
-#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
- BOOST_PP_CAT(a, n)( \
- boost::forward<BOOST_PP_CAT(A,n)>(BOOST_PP_CAT(b, n)))
-
-#else
-
-#define BOOST_UNORDERED_EARGS_MEMBER(z, n, _) \
- typedef typename boost::add_lvalue_reference<BOOST_PP_CAT(A, n)>::type \
- BOOST_PP_CAT(Arg, n); \
- BOOST_PP_CAT(Arg, n) BOOST_PP_CAT(a, n);
-
-#define BOOST_UNORDERED_EARGS_INIT(z, n, _) \
- BOOST_PP_CAT(a, n)(BOOST_PP_CAT(b, n))
-
-#endif
-
-BOOST_PP_REPEAT_FROM_TO(1, BOOST_UNORDERED_EMPLACE_LIMIT, BOOST_UNORDERED_EARGS,
- _)
-
-#undef BOOST_UNORDERED_DEFINE_EMPLACE_ARGS
-#undef BOOST_UNORDERED_EARGS_MEMBER
-#undef BOOST_UNORDERED_EARGS_INIT
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // rvalue parameters when type can't be a BOOST_RV_REF(T) parameter
- // e.g. for int
-
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
-# define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
-#else
- struct please_ignore_this_overload {
- typedef please_ignore_this_overload type;
- };
-
- template <typename T>
- struct rv_ref_impl {
- typedef BOOST_RV_REF(T) type;
- };
-
- template <typename T>
- struct rv_ref :
- boost::detail::if_true<
- boost::is_class<T>::value
- >::BOOST_NESTED_TEMPLATE then <
- boost::unordered::detail::rv_ref_impl<T>,
- please_ignore_this_overload
- >::type
- {};
-
-# define BOOST_UNORDERED_RV_REF(T) \
- typename boost::unordered::detail::rv_ref<T>::type
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct from tuple
- //
- // Used for piecewise construction.
-
-#if !defined(__SUNPRO_CC)
-
-# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
- template<typename T> \
- void construct_from_tuple(T* ptr, namespace_ tuple<>) \
- { \
- new ((void*) ptr) T(); \
- } \
- \
- BOOST_PP_REPEAT_FROM_TO(1, n, \
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
-
-# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, namespace_) \
- template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- void construct_from_tuple(T* ptr, \
- namespace_ tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
- { \
- new ((void*) ptr) T( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
- ); \
- }
-
-# define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
- namespace_ get<n>(x)
-
-#else
-
- template <int N> struct length {};
-
-# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
- template<typename T> \
- void construct_from_tuple_impl( \
- boost::unordered::detail::length<0>, T* ptr, \
- namespace_ tuple<>) \
- { \
- new ((void*) ptr) T(); \
- } \
- \
- BOOST_PP_REPEAT_FROM_TO(1, n, \
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
-
-# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, namespace_) \
- template<typename T, BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
- void construct_from_tuple_impl( \
- boost::unordered::detail::length<n>, T* ptr, \
- namespace_ tuple<BOOST_PP_ENUM_PARAMS_Z(z, n, A)> const& x) \
- { \
- new ((void*) ptr) T( \
- BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_GET_TUPLE_ARG, namespace_) \
- ); \
- }
-
-# define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
- namespace_ get<n>(x)
-
-#endif
-
-BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost::)
-
-#if !defined(__SUNPRO_CC) && !defined(BOOST_NO_0X_HDR_TUPLE)
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std::)
-#endif
-
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
-#undef BOOST_UNORDERED_GET_TUPLE_ARG
-
-#if defined(__SUNPRO_CC)
-
- template <typename T, typename Tuple>
- void construct_from_tuple(T* ptr, Tuple const& x)
- {
- construct_from_tuple_impl(
- boost::unordered::detail::length<
- boost::tuples::length<Tuple>::value>(),
- ptr, x);
- }
-
-#endif
-
- ////////////////////////////////////////////////////////////////////////////
- // SFINAE traits for construction.
-
- // Decide which construction method to use for a three argument
- // call. Note that this is difficult to do using overloads because
- // the arguments are packed into 'emplace_args3'.
- //
- // The decision is made on the first argument.
-
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- template <typename A, typename B, typename A0>
- struct emulation1 {
- static choice1::type test(choice1, std::pair<A, B> const&);
- static choice2::type test(choice2, A const&);
- static choice3::type test(choice3, convert_from_anything const&);
-
- enum { value =
- sizeof(test(choose(), boost::unordered::detail::make<A0>())) ==
- sizeof(choice2::type) };
- };
-#endif
-
- template <typename A, typename B, typename A0>
- struct check3_base {
- static choice1::type test(choice1,
- boost::unordered::piecewise_construct_t);
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- static choice2::type test(choice2, A const&);
-#endif
-
- static choice3::type test(choice3, ...);
-
- enum { value =
- sizeof(test(choose(), boost::unordered::detail::make<A0>())) };
- };
-
- template <typename A, typename B, typename A0>
- struct piecewise3 {
- enum { value = check3_base<A,B,A0>::value == sizeof(choice1::type) };
- };
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
- template <typename A, typename B, typename A0>
- struct emulation3 {
- enum { value = check3_base<A,B,A0>::value == sizeof(choice2::type) };
- };
-
-#endif
-
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct from variadic parameters
-
- template <typename T, typename... Args>
- inline void construct_impl(T* address, Args&&... args)
- {
- new((void*) address) T(boost::forward<Args>(args)...);
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<piecewise3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&&, A1&& a1, A2&& a2)
- {
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->first), a1);
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->second), a2);
- }
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
-
- template <typename A, typename B, typename A0>
- inline typename enable_if<emulation1<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&& a0)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
- new((void*) boost::addressof(address->second)) B();
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address, A0&& a0, A1&& a1, A2&& a2)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(a1),
- boost::forward<A2>(a2));
- }
-
- template <typename A, typename B,
- typename A0, typename A1, typename A2, typename A3,
- typename... Args>
- inline void construct_impl(std::pair<A, B>* address,
- A0&& a0, A1&& a1, A2&& a2, A3&& a3, Args&&... args)
- {
- new((void*) boost::addressof(address->first)) A(boost::forward<A0>(a0));
-
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(a1),
- boost::forward<A2>(a2),
- boost::forward<A3>(a3),
- boost::forward<Args>(args)...);
- }
-
-#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
-#else // BOOST_UNORDERED_VARIADIC_MOVE
-
-////////////////////////////////////////////////////////////////////////////////
-// Construct from emplace_args
-
-#define BOOST_UNORDERED_CONSTRUCT_IMPL(z, num_params, _) \
- template < \
- typename T, \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
- > \
- inline void construct_impl(T* address, \
- boost::unordered::detail::BOOST_PP_CAT(emplace_args,num_params) < \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
- > const& args) \
- { \
- new((void*) address) T( \
- BOOST_PP_ENUM_##z(num_params, BOOST_UNORDERED_CALL_FORWARD, \
- args.a)); \
- }
-
- template <typename T, typename A0>
- inline void construct_impl(T* address, emplace_args1<A0> const& args)
- {
- new((void*) address) T(boost::forward<A0>(args.a0));
- }
-
- template <typename T, typename A0, typename A1>
- inline void construct_impl(T* address, emplace_args2<A0, A1> const& args)
- {
- new((void*) address) T(
- boost::forward<A0>(args.a0),
- boost::forward<A1>(args.a1)
- );
- }
-
- template <typename T, typename A0, typename A1, typename A2>
- inline void construct_impl(T* address, emplace_args3<A0, A1, A2> const& args)
- {
- new((void*) address) T(
- boost::forward<A0>(args.a0),
- boost::forward<A1>(args.a1),
- boost::forward<A2>(args.a2)
- );
- }
-
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
- BOOST_UNORDERED_CONSTRUCT_IMPL, _)
-
-#undef BOOST_UNORDERED_CONSTRUCT_IMPL
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<piecewise3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
- {
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->first), args.a1);
- boost::unordered::detail::construct_from_tuple(
- boost::addressof(address->second), args.a2);
- }
-
-#if defined(BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT)
-
- template <typename A, typename B, typename A0>
- inline typename enable_if<emulation1<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args1<A0> const& args)
- {
- new((void*) boost::addressof(address->first)) A(
- boost::forward<A0>(args.a0));
- new((void*) boost::addressof(address->second)) B();
- }
-
- template <typename A, typename B, typename A0, typename A1, typename A2>
- inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(std::pair<A, B>* address,
- boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
- {
- new((void*) boost::addressof(address->first)) A(
- boost::forward<A0>(args.a0));
- new((void*) boost::addressof(address->second)) B(
- boost::forward<A1>(args.a1),
- boost::forward<A2>(args.a2));
- }
-
-#define BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(z, num_params, _) \
- template <typename A, typename B, \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, typename A) \
- > \
- inline void construct_impl(std::pair<A, B>* address, \
- boost::unordered::detail::BOOST_PP_CAT(emplace_args, num_params) < \
- BOOST_PP_ENUM_PARAMS_Z(z, num_params, A) \
- > const& args) \
- { \
- new((void*) boost::addressof(address->first)) A( \
- boost::forward<A0>(args.a0)); \
- new((void*) boost::addressof(address->second)) B( \
- BOOST_PP_ENUM_##z(BOOST_PP_DEC(num_params), \
- BOOST_UNORDERED_CALL_FORWARD2, args.a)); \
- }
-
-#define BOOST_UNORDERED_CALL_FORWARD2(z, i, a) \
- BOOST_UNORDERED_CALL_FORWARD(z, BOOST_PP_INC(i), a)
-
- BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL(1, 2, _)
- BOOST_PP_REPEAT_FROM_TO(4, BOOST_UNORDERED_EMPLACE_LIMIT,
- BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL, _)
-
-#undef BOOST_UNORDERED_CONSTRUCT_PAIR_IMPL
-#undef BOOST_UNORDERED_CALL_FORWARD2
-
-#endif // BOOST_UNORDERED_DEPRECATED_PAIR_CONSTRUCT
-#endif // BOOST_UNORDERED_VARIADIC_MOVE
-
- ////////////////////////////////////////////////////////////////////////////
- // Construct without using the emplace args mechanism.
-
- template <typename T, typename A0>
- inline void construct_impl2(T* address, BOOST_FWD_REF(A0) a0)
- {
- new((void*) address) T(
- boost::forward<A0>(a0)
- );
- }
-
-}}}
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
-#endif

Modified: branches/release/boost/unordered/detail/equivalent.hpp
==============================================================================
--- branches/release/boost/unordered/detail/equivalent.hpp (original)
+++ branches/release/boost/unordered/detail/equivalent.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -497,12 +497,21 @@
         }
 
 #if defined(BOOST_NO_RVALUE_REFERENCES)
+# if defined(BOOST_NO_VARIADIC_TEMPLATES)
         iterator emplace(boost::unordered::detail::emplace_args1<
                 boost::unordered::detail::please_ignore_this_overload> const&)
         {
             BOOST_ASSERT(false);
             return iterator();
         }
+# else
+ iterator emplace(
+ boost::unordered::detail::please_ignore_this_overload const&)
+ {
+ BOOST_ASSERT(false);
+ return iterator();
+ }
+# endif
 #endif
 
         template <BOOST_UNORDERED_EMPLACE_TEMPLATE>

Modified: branches/release/boost/unordered/detail/extract_key.hpp
==============================================================================
--- branches/release/boost/unordered/detail/extract_key.hpp (original)
+++ branches/release/boost/unordered/detail/extract_key.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -56,7 +56,7 @@
             return no_key();
         }
         
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class... Args>
         static no_key extract(Args const&...)
         {
@@ -111,7 +111,7 @@
             return v.first;
         }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class Arg1, class... Args>
         static key_type const& extract(key_type const& k,
             Arg1 const&, Args const&...)
@@ -150,12 +150,12 @@
         }
 #endif
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
 
 #define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \
         template <typename T2> \
         static no_key extract(boost::unordered::piecewise_construct_t, \
- namespace_::tuple<> const&, T2&&) \
+ namespace_::tuple<> const&, BOOST_FWD_REF(T2)) \
         { \
             return no_key(); \
         } \
@@ -163,7 +163,7 @@
         template <typename T, typename T2> \
         static typename is_key<key_type, T>::type \
             extract(boost::unordered::piecewise_construct_t, \
- namespace_::tuple<T> const& k, T2&&) \
+ namespace_::tuple<T> const& k, BOOST_FWD_REF(T2)) \
         { \
             return typename is_key<key_type, T>::type( \
                 namespace_::get<0>(k)); \

Modified: branches/release/boost/unordered/detail/unique.hpp
==============================================================================
--- branches/release/boost/unordered/detail/unique.hpp (original)
+++ branches/release/boost/unordered/detail/unique.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -379,38 +379,41 @@
             // exception (need strong safety in such a case).
             node_constructor a(this->node_alloc());
             a.construct_node();
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- a.construct_value(boost::unordered::piecewise_construct,
- boost::make_tuple(k), boost::make_tuple());
-#else
- a.construct_value(
- boost::unordered::detail::create_emplace_args(
- boost::unordered::piecewise_construct,
- boost::make_tuple(k),
- boost::make_tuple()));
-#endif
+
+ a.construct_value(BOOST_UNORDERED_EMPLACE_ARGS3(
+ boost::unordered::piecewise_construct,
+ boost::make_tuple(k),
+ boost::make_tuple()));
     
             this->reserve_for_insert(this->size_ + 1);
             return *add_node(a, key_hash);
         }
 
 #if defined(BOOST_NO_RVALUE_REFERENCES)
+# if defined(BOOST_NO_VARIADIC_TEMPLATES)
         emplace_return emplace(boost::unordered::detail::emplace_args1<
                 boost::unordered::detail::please_ignore_this_overload> const&)
         {
             BOOST_ASSERT(false);
             return emplace_return(this->begin(), false);
         }
+# else
+ emplace_return emplace(
+ boost::unordered::detail::please_ignore_this_overload const&)
+ {
+ BOOST_ASSERT(false);
+ return emplace_return(this->begin(), false);
+ }
+# endif
 #endif
 
         template <BOOST_UNORDERED_EMPLACE_TEMPLATE>
         emplace_return emplace(BOOST_UNORDERED_EMPLACE_ARGS)
         {
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
             return emplace_impl(
                 extractor::extract(BOOST_UNORDERED_EMPLACE_FORWARD),
                 BOOST_UNORDERED_EMPLACE_FORWARD);
-
 #else
             return emplace_impl(
                 extractor::extract(args.a0, args.a1),
@@ -418,7 +421,7 @@
 #endif
         }
 
-#if !defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <typename A0>
         emplace_return emplace(
                 boost::unordered::detail::emplace_args1<A0> const& args)

Modified: branches/release/boost/unordered/unordered_map.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_map.hpp (original)
+++ branches/release/boost/unordered/unordered_map.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -14,7 +14,6 @@
 #endif
 
 #include <boost/unordered/unordered_map_fwd.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
 #include <boost/unordered/detail/equivalent.hpp>
 #include <boost/unordered/detail/unique.hpp>
 #include <boost/unordered/detail/util.hpp>
@@ -233,15 +232,15 @@
 
         // emplace
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class... Args>
- std::pair<iterator, bool> emplace(Args&&... args)
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...).first;
         }
@@ -720,15 +719,15 @@
 
         // emplace
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class... Args>
- iterator emplace(Args&&... args)
+ iterator emplace(BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }

Modified: branches/release/boost/unordered/unordered_set.hpp
==============================================================================
--- branches/release/boost/unordered/unordered_set.hpp (original)
+++ branches/release/boost/unordered/unordered_set.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -14,7 +14,6 @@
 #endif
 
 #include <boost/unordered/unordered_set_fwd.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
 #include <boost/unordered/detail/equivalent.hpp>
 #include <boost/unordered/detail/unique.hpp>
 #include <boost/unordered/detail/util.hpp>
@@ -231,15 +230,15 @@
 
         // emplace
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class... Args>
- std::pair<iterator, bool> emplace(Args&&... args)
+ std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...).first;
         }
@@ -704,15 +703,15 @@
 
         // emplace
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         template <class... Args>
- iterator emplace(Args&&... args)
+ iterator emplace(BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }
 
         template <class... Args>
- iterator emplace_hint(const_iterator, Args&&... args)
+ iterator emplace_hint(const_iterator, BOOST_FWD_REF(Args)... args)
         {
             return table_.emplace(boost::forward<Args>(args)...);
         }

Modified: branches/release/libs/unordered/test/exception/insert_exception_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/exception/insert_exception_tests.cpp (original)
+++ branches/release/libs/unordered/test/exception/insert_exception_tests.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -32,7 +32,7 @@
         std::string scope(test::scope);
 
         if(scope.find("hash::operator()") == std::string::npos)
- strong.test(x, test::exception::detail::tracker.count_allocations);
+ strong.test(x, test::detail::tracker.count_allocations);
         test::check_equivalent_keys(x);
     }
 };
@@ -49,7 +49,7 @@
             it = this->values.begin(), end = this->values.end();
             it != end; ++it)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             x.emplace(*it);
         }
     }
@@ -67,7 +67,7 @@
             it = this->values.begin(), end = this->values.end();
             it != end; ++it)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             x.insert(*it);
         }
     }
@@ -83,7 +83,7 @@
             it = this->values.begin(), end = this->values.end();
             it != end; ++it)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             x.insert(x.begin(), *it);
         }
     }
@@ -111,7 +111,7 @@
             it = this->values.begin(), end = this->values.end();
             it != end; ++it)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             x.insert(it, boost::next(it));
         }
     }
@@ -150,7 +150,7 @@
                 end = this->values.end();
             it != end && count < 10; ++it, ++count)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             pos = x.insert(pos, *it);
         }
 
@@ -174,7 +174,7 @@
                 end = this->values.end();
             it != end && count < 10; ++it, ++count)
         {
- strong.store(x, test::exception::detail::tracker.count_allocations);
+ strong.store(x, test::detail::tracker.count_allocations);
             x.insert(*it);
         }
 

Deleted: branches/release/libs/unordered/test/helpers/allocator.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/allocator.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
+++ (empty file)
@@ -1,84 +0,0 @@
-
-// Copyright 2006-2009 Daniel James.
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !defined(BOOST_UNORDERED_TEST_MALLOC_ALLOCATOR_HEADER)
-#define BOOST_UNORDERED_TEST_MALLOC_ALLOCATOR_HEADER
-
-#include <cstddef>
-#include <cstdlib>
-#include <boost/limits.hpp>
-#include <new>
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#pragma warning(disable:4100) // unreferenced formal parameter
-#endif
-
-namespace test
-{
- template <class T>
- struct malloc_allocator
- {
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef T* pointer;
- typedef T const* const_pointer;
- typedef T& reference;
- typedef T const& const_reference;
- typedef T value_type;
-
- template <class U> struct rebind { typedef malloc_allocator<U> other; };
-
- malloc_allocator() {}
- template <class Y> malloc_allocator(malloc_allocator<Y> const&) {}
- malloc_allocator(malloc_allocator const&) {}
-
- pointer address(reference r) { return &r; }
- const_pointer address(const_reference r) { return &r; }
-
- pointer allocate(size_type n) {
- using namespace std;
- T* ptr = static_cast<T*>(malloc(n * sizeof(T)));
- if(!ptr) throw std::bad_alloc();
- return ptr;
- }
-
- pointer allocate(size_type n, void const* u) { return allocate(n); }
-
- void deallocate(pointer p, size_type) {
- using namespace std;
- free(p);
- }
- void construct(pointer p, T const& t) { new(p) T(t); }
- void destroy(pointer p) { p->~T(); }
-
- size_type max_size() const {
- return (std::numeric_limits<size_type>::max)();
- }
-
- bool operator==(malloc_allocator const&) const { return true; }
- bool operator!=(malloc_allocator const&) const { return false; }
-
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- template <class T> void deallocate(T* p, size_type) {
- using namespace std;
- free(p);
- }
- char* _Charalloc(size_type n) {
- using namespace std;
- T* ptr = static_cast<T*>(malloc(n * sizeof(char)));
- if(!ptr) throw std::bad_alloc();
- return (char*) ptr;
- }
-#endif
- };
-}
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#pragma warning(disable:4100) // unreferenced formal parameter
-#endif
-
-#endif

Modified: branches/release/libs/unordered/test/helpers/check_return_type.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/check_return_type.hpp (original)
+++ branches/release/libs/unordered/test/helpers/check_return_type.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -6,7 +6,7 @@
 #if !defined(BOOST_UNORDERED_TEST_HELPERS_CHECK_RETURN_TYPE_HEADER)
 #define BOOST_UNORDERED_TEST_HELPERS_CHECK_RETURN_TYPE_HEADER
 
-#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 
@@ -18,19 +18,19 @@
         template <class T2>
         static void equals(T2)
         {
- BOOST_MPL_ASSERT((boost::is_same<T1, T2>));
+ BOOST_STATIC_ASSERT((boost::is_same<T1, T2>::value));
         }
 
         template <class T2>
         static void equals_ref(T2&)
         {
- BOOST_MPL_ASSERT((boost::is_same<T1, T2>));
+ BOOST_STATIC_ASSERT((boost::is_same<T1, T2>::value));
         }
 
         template <class T2>
         static void convertible(T2)
         {
- BOOST_MPL_ASSERT((boost::is_convertible<T2, T1>));
+ BOOST_STATIC_ASSERT((boost::is_convertible<T2, T1>::value));
         }
     };
 }

Modified: branches/release/libs/unordered/test/helpers/count.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/count.hpp (original)
+++ branches/release/libs/unordered/test/helpers/count.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -52,30 +52,22 @@
         }
     };
 
- template <class T>
- struct counted_object
- {
- static object_count count_;
-
- counted_object() { count_.construct(); }
- counted_object(counted_object const&) { count_.construct(); }
- ~counted_object() { count_.destruct(); }
- };
-
- template <class T> object_count counted_object<T>::count_;
-
- struct globally_counted_object
- : counted_object<globally_counted_object> {};
-
     // This won't be a problem as I'm only using a single compile unit
     // in each test (this is actually require by the minimal test
     // framework).
     //
     // boostinspect:nounnamed
     namespace {
- object_count& global_object_count = globally_counted_object::count_;
+ object_count global_object_count;
     }
     
+ struct counted_object
+ {
+ counted_object() { global_object_count.construct(); }
+ counted_object(counted_object const&) { global_object_count.construct(); }
+ ~counted_object() { global_object_count.destruct(); }
+ };
+
     struct check_instances {
         int instances;
         

Modified: branches/release/libs/unordered/test/helpers/invariants.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/invariants.hpp (original)
+++ branches/release/libs/unordered/test/helpers/invariants.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -13,7 +13,6 @@
 #include <cmath>
 #include "./metafunctions.hpp"
 #include "./helpers.hpp"
-#include "./allocator.hpp"
 
 #if defined(BOOST_MSVC)
 #pragma warning(push)
@@ -29,10 +28,7 @@
     {
         BOOST_DEDUCED_TYPENAME X::key_equal eq = x1.key_eq();
         typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
- // Boost.Test was reporting memory leaks for std::set on g++-3.3.
- // So I work around it by using malloc.
- std::set<key_type, std::less<key_type>,
- test::malloc_allocator<key_type> > found_;
+ std::set<key_type, std::less<key_type> > found_;
 
         BOOST_DEDUCED_TYPENAME X::const_iterator
             it = x1.begin(), end = x1.end();

Modified: branches/release/libs/unordered/test/helpers/memory.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/memory.hpp (original)
+++ branches/release/libs/unordered/test/helpers/memory.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -8,10 +8,8 @@
 
 #include <memory>
 #include <map>
-#include <boost/mpl/apply.hpp>
 #include <boost/assert.hpp>
-#include <boost/unordered/detail/allocator_helpers.hpp>
-#include <boost/mpl/aux_/config/eti.hpp>
+#include <boost/unordered/detail/allocate.hpp>
 #include "../helpers/test.hpp"
 
 namespace test
@@ -53,30 +51,10 @@
             }
         };
 
- template <class Alloc>
- struct allocator_memory_type_gen {
- typedef std::map<memory_area, memory_track, memory_area_compare,
- Alloc> type;
- };
-
-#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
- template <>
- struct allocator_memory_type_gen<int> {
- typedef std::map<memory_area, memory_track, memory_area_compare>
- type;
- };
-#endif
-
- template <class Alloc = std::allocator<int> >
         struct memory_tracker {
- typedef BOOST_DEDUCED_TYPENAME
- ::boost::unordered::detail::rebind_wrap<Alloc,
- std::pair<memory_area const, memory_track> >::type
- allocator_type;
-
- typedef BOOST_DEDUCED_TYPENAME
- allocator_memory_type_gen<allocator_type>::type
- allocated_memory_type;
+ typedef std::map<memory_area, memory_track, memory_area_compare,
+ std::allocator<std::pair<memory_area const, memory_track> >
+ > allocated_memory_type;
 
             allocated_memory_type allocated_memory;
             unsigned int count_allocators;
@@ -139,7 +117,7 @@
             void track_deallocate(void* ptr, std::size_t n, std::size_t size,
                 int tag, bool check_tag_ = true)
             {
- BOOST_DEDUCED_TYPENAME allocated_memory_type::iterator pos =
+ allocated_memory_type::iterator pos =
                     allocated_memory.find(
                         memory_area(ptr, (char*) ptr + n * size));
                 if(pos == allocated_memory.end()) {
@@ -177,33 +155,9 @@
         //
         // boostinspect:nounnamed
         namespace {
- test::detail::memory_tracker<std::allocator<int> > tracker;
+ test::detail::memory_tracker tracker;
         }
     }
-
- template <int Value>
- struct bool_type {
- enum { value = (Value ? true : false) };
- };
-
- struct true_type {
- enum { value = true };
- };
-
- struct false_type {
- enum { value = false };
- };
-
- struct convert_from_anything
- {
- template <typename T>
- convert_from_anything(T const&) {}
- };
-
- int selected_count(convert_from_anything)
- {
- return 0;
- }
 }
 
 #endif

Modified: branches/release/libs/unordered/test/helpers/metafunctions.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/metafunctions.hpp (original)
+++ branches/release/libs/unordered/test/helpers/metafunctions.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -8,32 +8,11 @@
 
 #include <boost/config.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/mpl/not.hpp>
 #include <boost/unordered_set.hpp>
 #include <boost/unordered_map.hpp>
 
 namespace test
 {
- /*
- struct unordered_set_type { char x[100]; };
- struct unordered_multiset_type { char x[200]; };
- struct unordered_map_type { char x[300]; };
- struct unordered_multimap_type { char x[400]; };
-
- template <class V, class H, class P, class A>
- unordered_set_type container_type(
- boost::unordered_set<V, H, P, A> const*);
- template <class V, class H, class P, class A>
- unordered_multiset_type container_type(
- boost::unordered_multiset<V, H, P, A> const*);
- template <class K, class M, class H, class P, class A>
- unordered_map_type container_type(
- boost::unordered_map<K, M, H, P, A> const*);
- template <class K, class M, class H, class P, class A>
- unordered_multimap_type container_type(
- boost::unordered_multimap<K, M, H, P, A> const*);
- */
-
     template <class Container>
     struct is_set
         : public boost::is_same<
@@ -41,39 +20,21 @@
             BOOST_DEDUCED_TYPENAME Container::value_type> {};
 
     template <class Container>
- struct is_map
- : public boost::mpl::not_<is_set<Container> > {};
-
- struct yes_type { char x[100]; };
- struct no_type { char x[200]; };
+ struct has_unique_keys
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
 
     template <class V, class H, class P, class A>
- yes_type has_unique_key_impl(
- boost::unordered_set<V, H, P, A> const*);
- template <class V, class H, class P, class A>
- no_type has_unique_key_impl(
- boost::unordered_multiset<V, H, P, A> const*);
- template <class K, class M, class H, class P, class A>
- yes_type has_unique_key_impl(
- boost::unordered_map<K, M, H, P, A> const*);
- template <class K, class M, class H, class P, class A>
- no_type has_unique_key_impl(
- boost::unordered_multimap<K, M, H, P, A> const*);
-
- template <class Container>
- struct has_unique_keys
+ struct has_unique_keys<boost::unordered_set<V, H, P, A> >
     {
- BOOST_STATIC_CONSTANT(bool, value =
- sizeof(has_unique_key_impl((Container const*)0))
- == sizeof(yes_type));
+ BOOST_STATIC_CONSTANT(bool, value = true);
     };
 
- template <class Container>
- struct has_equivalent_keys
+ template <class K, class M, class H, class P, class A>
+ struct has_unique_keys<boost::unordered_map<K, M, H, P, A> >
     {
- BOOST_STATIC_CONSTANT(bool, value =
- sizeof(has_unique_key_impl((Container const*)0))
- == sizeof(no_type));
+ BOOST_STATIC_CONSTANT(bool, value = true);
     };
 }
 

Modified: branches/release/libs/unordered/test/helpers/random_values.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/random_values.hpp (original)
+++ branches/release/libs/unordered/test/helpers/random_values.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -8,7 +8,7 @@
 
 #include "./list.hpp"
 #include <algorithm>
-#include <boost/mpl/if.hpp>
+#include <boost/detail/select_type.hpp>
 #include "./generators.hpp"
 #include "./metafunctions.hpp"
 
@@ -81,10 +81,12 @@
 
     template <class X>
     struct unordered_generator_base
- : public boost::mpl::if_<
- test::is_set<X>,
+ : public boost::detail::if_true<
+ test::is_set<X>::value
+ >::BOOST_NESTED_TEMPLATE then<
             test::unordered_generator_set<X>,
- test::unordered_generator_map<X> >
+ test::unordered_generator_map<X>
+ >
     {
     };
 

Modified: branches/release/libs/unordered/test/helpers/strong.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/strong.hpp (original)
+++ branches/release/libs/unordered/test/helpers/strong.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -8,7 +8,6 @@
 
 #include <boost/config.hpp>
 #include <iterator>
-#include "./metafunctions.hpp"
 #include "./equivalent.hpp"
 #include "./list.hpp"
 #include "./exception_test.hpp"

Modified: branches/release/libs/unordered/test/helpers/tracker.hpp
==============================================================================
--- branches/release/libs/unordered/test/helpers/tracker.hpp (original)
+++ branches/release/libs/unordered/test/helpers/tracker.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -13,9 +13,6 @@
 #include <map>
 #include <iterator>
 #include <algorithm>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include "../objects/fwd.hpp"
 #include "./metafunctions.hpp"
@@ -25,21 +22,17 @@
 
 namespace test
 {
- template <class X>
- struct equals_to_compare2
- : public boost::mpl::identity<
- std::less<BOOST_DEDUCED_TYPENAME X::first_argument_type> >
+ template <typename X>
+ struct equals_to_compare
     {
+ typedef std::less<BOOST_DEDUCED_TYPENAME X::first_argument_type>
+ type;
     };
 
- template <class X>
- struct equals_to_compare
- : public boost::mpl::eval_if<
- boost::is_same<X, test::equal_to>,
- boost::mpl::identity<test::less>,
- equals_to_compare2<X>
- >
+ template <>
+ struct equals_to_compare<test::equal_to>
     {
+ typedef test::less type;
     };
 
     template <class X1, class X2>
@@ -67,51 +60,40 @@
                     values2.begin(), test::equivalent));
     }
 
- template <class X>
- struct ordered_set : public
- boost::mpl::if_<
- test::has_unique_keys<X>,
- std::set<
- BOOST_DEDUCED_TYPENAME X::value_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<
- BOOST_DEDUCED_TYPENAME X::key_equal
- >::type
- >,
- std::multiset<
- BOOST_DEDUCED_TYPENAME X::value_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<
- BOOST_DEDUCED_TYPENAME X::key_equal
- >::type
- >
- > {};
+ template <typename X>
+ struct ordered_base;
 
- template <class X>
- struct ordered_map : public
- boost::mpl::if_<
- test::has_unique_keys<X>,
- std::map<
- BOOST_DEDUCED_TYPENAME X::key_type,
- BOOST_DEDUCED_TYPENAME X::mapped_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<
- BOOST_DEDUCED_TYPENAME X::key_equal
- >::type
- >,
- std::multimap<
- BOOST_DEDUCED_TYPENAME X::key_type,
- BOOST_DEDUCED_TYPENAME X::mapped_type,
- BOOST_DEDUCED_TYPENAME equals_to_compare<
- BOOST_DEDUCED_TYPENAME X::key_equal
- >::type
- >
- > {};
+ template <class V, class H, class P, class A>
+ struct ordered_base<boost::unordered_set<V, H, P, A> >
+ {
+ typedef std::set<V,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<P>::type>
+ type;
+ };
 
- template <class X>
- struct ordered_base : public
- boost::mpl::eval_if<
- test::is_set<X>,
- test::ordered_set<X>,
- test::ordered_map<X>
- > {};
+ template <class V, class H, class P, class A>
+ struct ordered_base<boost::unordered_multiset<V, H, P, A> >
+ {
+ typedef std::multiset<V,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<P>::type>
+ type;
+ };
+
+ template <class K, class M, class H, class P, class A>
+ struct ordered_base<boost::unordered_map<K, M, H, P, A> >
+ {
+ typedef std::map<K, M,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<P>::type>
+ type;
+ };
+
+ template <class K, class M, class H, class P, class A>
+ struct ordered_base<boost::unordered_multimap<K, M, H, P, A> >
+ {
+ typedef std::multimap<K, M,
+ BOOST_DEDUCED_TYPENAME equals_to_compare<P>::type>
+ type;
+ };
 
     template <class X>
     class ordered : public ordered_base<X>::type

Modified: branches/release/libs/unordered/test/objects/cxx11_allocator.hpp
==============================================================================
--- branches/release/libs/unordered/test/objects/cxx11_allocator.hpp (original)
+++ branches/release/libs/unordered/test/objects/cxx11_allocator.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -21,7 +21,8 @@
             is_select_on_copy = 0,
             is_propagate_on_swap = 0,
             is_propagate_on_assign = 0,
- is_propagate_on_move = 0
+ is_propagate_on_move = 0,
+ cxx11_construct = 0
         };
     };
 
@@ -31,7 +32,8 @@
             is_select_on_copy = 1,
             is_propagate_on_swap = 1,
             is_propagate_on_assign = 1,
- is_propagate_on_move = 1
+ is_propagate_on_move = 1,
+ cxx11_construct = 1
         };
     };
     
@@ -168,8 +170,8 @@
             new(p) T(t);
         }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- template<typename... Args> void construct(T* p, Args&&... args) {
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<typename... Args> void construct(T* p, BOOST_FWD_REF(Args)... args) {
             detail::tracker.track_construct((void*) p, sizeof(T), tag_);
             new(p) T(boost::forward<Args>(args)...);
         }
@@ -291,6 +293,20 @@
         return x.tag_ == y.tag_;
     }
 
+ // Function to check how many times an allocator has been selected,
+ // return 0 for other allocators.
+
+ struct convert_from_anything
+ {
+ template <typename T>
+ convert_from_anything(T const&) {}
+ };
+
+ inline int selected_count(convert_from_anything)
+ {
+ return 0;
+ }
+
     template <typename T, typename Flags>
     int selected_count(cxx11_allocator<T, Flags> const& x)
     {

Modified: branches/release/libs/unordered/test/objects/exception.hpp
==============================================================================
--- branches/release/libs/unordered/test/objects/exception.hpp (original)
+++ branches/release/libs/unordered/test/objects/exception.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -13,21 +13,12 @@
 #include <boost/limits.hpp>
 #include <new>
 #include "../helpers/fwd.hpp"
-#include "../helpers/allocator.hpp"
 #include "../helpers/memory.hpp"
 
 namespace test
 {
 namespace exception
 {
- namespace detail
- {
- namespace
- {
- test::detail::memory_tracker<test::malloc_allocator<int> > tracker;
- }
- }
-
     class object;
     class hash;
     class equal_to;
@@ -259,7 +250,7 @@
             UNORDERED_SCOPE(allocator::allocator()) {
                 UNORDERED_EPOINT("Mock allocator default constructor.");
             }
- detail::tracker.allocator_ref();
+ test::detail::tracker.allocator_ref();
         }
 
         template <class Y> allocator(allocator<Y> const& x) : tag_(x.tag_)
@@ -267,7 +258,7 @@
             UNORDERED_SCOPE(allocator::allocator()) {
                 UNORDERED_EPOINT("Mock allocator template copy constructor.");
             }
- detail::tracker.allocator_ref();
+ test::detail::tracker.allocator_ref();
         }
 
         allocator(allocator const& x) : tag_(x.tag_)
@@ -275,11 +266,11 @@
             UNORDERED_SCOPE(allocator::allocator()) {
                 UNORDERED_EPOINT("Mock allocator copy constructor.");
             }
- detail::tracker.allocator_ref();
+ test::detail::tracker.allocator_ref();
         }
 
         ~allocator() {
- detail::tracker.allocator_unref();
+ test::detail::tracker.allocator_unref();
         }
 
         allocator& operator=(allocator const& x) {
@@ -317,7 +308,7 @@
                 ptr = (T*) malloc(n * sizeof(T));
                 if(!ptr) throw std::bad_alloc();
             }
- detail::tracker.track_allocate((void*) ptr, n, sizeof(T), tag_);
+ test::detail::tracker.track_allocate((void*) ptr, n, sizeof(T), tag_);
             return pointer(ptr);
 
             //return pointer(static_cast<T*>(::operator new(n * sizeof(T))));
@@ -333,7 +324,7 @@
                 ptr = (T*) malloc(n * sizeof(T));
                 if(!ptr) throw std::bad_alloc();
             }
- detail::tracker.track_allocate((void*) ptr, n, sizeof(T), tag_);
+ test::detail::tracker.track_allocate((void*) ptr, n, sizeof(T), tag_);
             return pointer(ptr);
 
             //return pointer(static_cast<T*>(::operator new(n * sizeof(T))));
@@ -343,7 +334,7 @@
         {
             //::operator delete((void*) p);
             if(p) {
- detail::tracker.track_deallocate((void*) p, n, sizeof(T), tag_);
+ test::detail::tracker.track_deallocate((void*) p, n, sizeof(T), tag_);
                 using namespace std;
                 free(p);
             }
@@ -354,21 +345,21 @@
                 UNORDERED_EPOINT("Mock allocator construct function.");
                 new(p) T(t);
             }
- detail::tracker.track_construct((void*) p, sizeof(T), tag_);
+ test::detail::tracker.track_construct((void*) p, sizeof(T), tag_);
         }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- template<class... Args> void construct(T* p, Args&&... args) {
- UNORDERED_SCOPE(allocator::construct(pointer, Args&&...)) {
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<class... Args> void construct(T* p, BOOST_FWD_REF(Args)... args) {
+ UNORDERED_SCOPE(allocator::construct(pointer, BOOST_FWD_REF(Args)...)) {
                 UNORDERED_EPOINT("Mock allocator construct function.");
                 new(p) T(boost::forward<Args>(args)...);
             }
- detail::tracker.track_construct((void*) p, sizeof(T), tag_);
+ test::detail::tracker.track_construct((void*) p, sizeof(T), tag_);
         }
 #endif
 
         void destroy(T* p) {
- detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
+ test::detail::tracker.track_destroy((void*) p, sizeof(T), tag_);
             p->~T();
         }
 

Modified: branches/release/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- branches/release/libs/unordered/test/objects/minimal.hpp (original)
+++ branches/release/libs/unordered/test/objects/minimal.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -367,8 +367,8 @@
 
         void construct(T* p, T const& t) { new((void*)p) T(t); }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- template<class... Args> void construct(T* p, Args&&... args) {
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<class... Args> void construct(T* p, BOOST_FWD_REF(Args)... args) {
             new((void*)p) T(boost::forward<Args>(args)...);
         }
 #endif
@@ -439,8 +439,8 @@
 
         void construct(T* p, T const& t) { new((void*)p) T(t); }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- template<class... Args> void construct(T* p, Args&&... args) {
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<class... Args> void construct(T* p, BOOST_FWD_REF(Args)... args) {
             new((void*)p) T(boost::forward<Args>(args)...);
         }
 #endif

Modified: branches/release/libs/unordered/test/objects/test.hpp
==============================================================================
--- branches/release/libs/unordered/test/objects/test.hpp (original)
+++ branches/release/libs/unordered/test/objects/test.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -26,7 +26,7 @@
     object generate(object const*);
     implicitly_convertible generate(implicitly_convertible const*);
     
- class object : private globally_counted_object
+ class object : private counted_object
     {
         friend class hash;
         friend class equal_to;
@@ -64,7 +64,7 @@
         }
     };
 
- class implicitly_convertible : private globally_counted_object
+ class implicitly_convertible : private counted_object
     {
         int tag1_, tag2_;
     public:
@@ -259,8 +259,8 @@
             new(p) T(t);
         }
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
- template<class... Args> void construct(T* p, Args&&... args) {
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+ template<class... Args> void construct(T* p, BOOST_FWD_REF(Args)... args) {
             detail::tracker.track_construct((void*) p, sizeof(T), tag_);
             new(p) T(boost::forward<Args>(args)...);
         }

Modified: branches/release/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- branches/release/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ branches/release/libs/unordered/test/unordered/Jamfile.v2 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -15,9 +15,6 @@
         <toolset>darwin:<cxxflags>"-pedantic -Wstrict-aliasing -fstrict-aliasing -Wextra -Wsign-promo -Wunused-parameter -Wconversion -Wfloat-equal"
         #<toolset>gcc:<define>_GLIBCXX_DEBUG
         #<toolset>darwin:<define>_GLIBCXX_DEBUG
- #<toolset>msvc:<warnings-as-errors>on
- <toolset>gcc:<warnings-as-errors>on
- <toolset>darwin:<warnings-as-errors>on
     ;
 
 test-suite unordered

Modified: branches/release/libs/unordered/test/unordered/allocator_traits.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/allocator_traits.cpp (original)
+++ branches/release/libs/unordered/test/unordered/allocator_traits.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -3,10 +3,10 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/unordered/detail/allocator_helpers.hpp>
+#include <boost/unordered/detail/allocate.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/limits.hpp>
 
 // Boilerplate
@@ -91,15 +91,15 @@
     typedef empty_allocator<int> allocator;
     typedef boost::unordered::detail::allocator_traits<allocator> traits;
 #if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type,
- std::make_unsigned<std::ptrdiff_t>::type>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>::value));
 #else
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type, std::size_t>::value));
 #endif
- BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
- BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, int const*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::value_type, int>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::pointer, int*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::const_pointer, int const*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::value_type, int>::value));
     BOOST_TEST(!traits::propagate_on_container_copy_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_move_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_swap::value);
@@ -129,15 +129,15 @@
     typedef allocator1<int> allocator;
     typedef boost::unordered::detail::allocator_traits<allocator> traits;
 #if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type,
- std::make_unsigned<std::ptrdiff_t>::type>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>::value));
 #else
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type, std::size_t>::value));
 #endif
- BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
- BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, int const*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::value_type, int>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::pointer, int*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::const_pointer, int const*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::value_type, int>::value));
     BOOST_TEST(traits::propagate_on_container_copy_assignment::value);
     BOOST_TEST(traits::propagate_on_container_move_assignment::value);
     BOOST_TEST(traits::propagate_on_container_swap::value);
@@ -174,11 +174,11 @@
 {
     typedef allocator2<int> allocator;
     typedef boost::unordered::detail::allocator_traits<allocator> traits;
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type, std::size_t>));
- BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
- BOOST_MPL_ASSERT((boost::is_same<traits::pointer, int*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, int const*>));
- BOOST_MPL_ASSERT((boost::is_same<traits::value_type, int>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type, std::size_t>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::pointer, int*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::const_pointer, int const*>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::value_type, int>::value));
     BOOST_TEST(!traits::propagate_on_container_copy_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_move_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_swap::value);
@@ -233,11 +233,11 @@
 {
     typedef allocator3<int> allocator;
     typedef boost::unordered::detail::allocator_traits<allocator> traits;
- BOOST_MPL_ASSERT((boost::is_same<traits::size_type, unsigned short>));
- BOOST_MPL_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>));
- BOOST_MPL_ASSERT((boost::is_same<traits::pointer, ptr<int> >));
- BOOST_MPL_ASSERT((boost::is_same<traits::const_pointer, ptr<int const> >));
- BOOST_MPL_ASSERT((boost::is_same<traits::value_type, int>));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::size_type, unsigned short>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::difference_type, std::ptrdiff_t>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::pointer, ptr<int> >::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::const_pointer, ptr<int const> >::value));
+ BOOST_STATIC_ASSERT((boost::is_same<traits::value_type, int>::value));
     BOOST_TEST(traits::propagate_on_container_copy_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_move_assignment::value);
     BOOST_TEST(!traits::propagate_on_container_swap::value);

Modified: branches/release/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ branches/release/libs/unordered/test/unordered/compile_tests.hpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -16,8 +16,7 @@
 #pragma warning(pop)
 #endif
 
-#include <boost/mpl/assert.hpp>
-#include <boost/mpl/bool.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 #include <boost/iterator/iterator_traits.hpp>
@@ -55,42 +54,38 @@
 
     // value_type
 
- BOOST_MPL_ASSERT((boost::is_same<T, value_type>));
+ BOOST_STATIC_ASSERT((boost::is_same<T, value_type>::value));
     boost::function_requires<boost::CopyConstructibleConcept<X> >();
 
     // reference_type / const_reference_type
 
- BOOST_MPL_ASSERT((boost::is_same<T&, reference>));
- BOOST_MPL_ASSERT((boost::is_same<T const&, const_reference>));
+ BOOST_STATIC_ASSERT((boost::is_same<T&, reference>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<T const&, const_reference>::value));
 
     // iterator
 
     boost::function_requires<boost::InputIteratorConcept<iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<T, iterator_value_type>));
- BOOST_MPL_ASSERT((boost::is_convertible<iterator, const_iterator>));
+ BOOST_STATIC_ASSERT((boost::is_same<T, iterator_value_type>::value));
+ BOOST_STATIC_ASSERT((boost::is_convertible<iterator, const_iterator>::value));
 
     // const_iterator
 
     boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<T, const_iterator_value_type>));
+ BOOST_STATIC_ASSERT((boost::is_same<T, const_iterator_value_type>::value));
 
     // difference_type
 
- BOOST_MPL_ASSERT((boost::mpl::bool_<
- std::numeric_limits<difference_type>::is_signed>));
- BOOST_MPL_ASSERT((boost::mpl::bool_<
- std::numeric_limits<difference_type>::is_integer>));
- BOOST_MPL_ASSERT((boost::is_same<difference_type,
- iterator_difference_type>));
- BOOST_MPL_ASSERT((boost::is_same<difference_type,
- const_iterator_difference_type>));
+ BOOST_STATIC_ASSERT(std::numeric_limits<difference_type>::is_signed);
+ BOOST_STATIC_ASSERT(std::numeric_limits<difference_type>::is_integer);
+ BOOST_STATIC_ASSERT((boost::is_same<difference_type,
+ iterator_difference_type>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<difference_type,
+ const_iterator_difference_type>::value));
 
     // size_type
 
- BOOST_MPL_ASSERT_NOT((boost::mpl::bool_<
- std::numeric_limits<size_type>::is_signed>));
- BOOST_MPL_ASSERT((boost::mpl::bool_<
- std::numeric_limits<size_type>::is_integer>));
+ BOOST_STATIC_ASSERT(!std::numeric_limits<size_type>::is_signed);
+ BOOST_STATIC_ASSERT(std::numeric_limits<size_type>::is_integer);
 
     // size_type can represent any non-negative value type of difference_type
     // I'm not sure about either of these tests...
@@ -184,7 +179,7 @@
     typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
     typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
 
- BOOST_MPL_ASSERT((boost::is_same<value_type, key_type>));
+ BOOST_STATIC_ASSERT((boost::is_same<value_type, key_type>::value));
 }
 
 template <class X, class Key, class T>
@@ -193,8 +188,8 @@
     typedef BOOST_DEDUCED_TYPENAME X::value_type value_type;
     typedef BOOST_DEDUCED_TYPENAME X::key_type key_type;
 
- BOOST_MPL_ASSERT((
- boost::is_same<value_type, std::pair<key_type const, T> >));
+ BOOST_STATIC_ASSERT((
+ boost::is_same<value_type, std::pair<key_type const, T> >::value));
 
     r.insert(std::pair<Key const, T>(k, v));
 
@@ -313,36 +308,36 @@
         boost::iterator_reference<const_local_iterator>::type
         const_local_iterator_reference;
 
- BOOST_MPL_ASSERT((boost::is_same<Key, key_type>));
+ BOOST_STATIC_ASSERT((boost::is_same<Key, key_type>::value));
     //boost::function_requires<boost::CopyConstructibleConcept<key_type> >();
     //boost::function_requires<boost::AssignableConcept<key_type> >();
 
- BOOST_MPL_ASSERT((boost::is_same<Hash, hasher>));
+ BOOST_STATIC_ASSERT((boost::is_same<Hash, hasher>::value));
     test::check_return_type<std::size_t>::equals(hf(k));
 
- BOOST_MPL_ASSERT((boost::is_same<Pred, key_equal>));
+ BOOST_STATIC_ASSERT((boost::is_same<Pred, key_equal>::value));
     test::check_return_type<bool>::convertible(eq(k, k));
 
     boost::function_requires<boost::InputIteratorConcept<local_iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_category,
- iterator_category>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_difference,
- iterator_difference>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_pointer,
- iterator_pointer>));
- BOOST_MPL_ASSERT((boost::is_same<local_iterator_reference,
- iterator_reference>));
+ BOOST_STATIC_ASSERT((boost::is_same<local_iterator_category,
+ iterator_category>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<local_iterator_difference,
+ iterator_difference>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<local_iterator_pointer,
+ iterator_pointer>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<local_iterator_reference,
+ iterator_reference>::value));
 
     boost::function_requires<
         boost::InputIteratorConcept<const_local_iterator> >();
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_category,
- const_iterator_category>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_difference,
- const_iterator_difference>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_pointer,
- const_iterator_pointer>));
- BOOST_MPL_ASSERT((boost::is_same<const_local_iterator_reference,
- const_iterator_reference>));
+ BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator_category,
+ const_iterator_category>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator_difference,
+ const_iterator_difference>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator_pointer,
+ const_iterator_pointer>::value));
+ BOOST_STATIC_ASSERT((boost::is_same<const_local_iterator_reference,
+ const_iterator_reference>::value));
 
     X(10, hf, eq);
     X a(10, hf, eq);

Modified: branches/release/libs/unordered/test/unordered/incomplete_test.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/incomplete_test.cpp (original)
+++ branches/release/libs/unordered/test/unordered/incomplete_test.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -15,26 +15,25 @@
     struct D { boost::unordered_map<D, D> x; };
 }
 
-namespace test
+namespace incomplete_test
 {
     // Declare, but don't define some types.
 
     struct value;
     struct hash;
     struct equals;
- template <class T>
- struct malloc_allocator;
+ template <class T> struct allocator;
 
     // Declare some instances
     
     typedef boost::unordered_map<value, value, hash, equals,
- malloc_allocator<std::pair<value const, value> > > map;
+ allocator<std::pair<value const, value> > > map;
     typedef boost::unordered_multimap<value, value, hash, equals,
- malloc_allocator<std::pair<value const, value> > > multimap;
+ allocator<std::pair<value const, value> > > multimap;
     typedef boost::unordered_set<value, hash, equals,
- malloc_allocator<value> > set;
+ allocator<value> > set;
     typedef boost::unordered_multiset<value, hash, equals,
- malloc_allocator<value> > multiset;
+ allocator<value> > multiset;
     
     // Now define the types which are stored as members, as they are needed for
     // declaring struct members.
@@ -49,12 +48,17 @@
         bool operator()(T const&, T const&) const { return true; }
     };
 
-}
-
-#include "../helpers/allocator.hpp"
+ // This is a dubious way to implement an allocator, but good enough
+ // for this test.
+ template <typename T>
+ struct allocator : std::allocator<T> {
+ allocator() {}
+
+ template <typename T2>
+ allocator(const allocator<T2>& other) :
+ std::allocator<T>(other) {}
+ };
 
-namespace test
-{
     // Declare some members of a structs.
     //
     // Incomplete hash, equals and allocator aren't here supported at the
@@ -62,19 +66,19 @@
     
     struct struct1 {
         boost::unordered_map<struct1, struct1, hash, equals,
- malloc_allocator<std::pair<struct1 const, struct1> > > x;
+ allocator<std::pair<struct1 const, struct1> > > x;
     };
     struct struct2 {
         boost::unordered_multimap<struct2, struct2, hash, equals,
- malloc_allocator<std::pair<struct2 const, struct2> > > x;
+ allocator<std::pair<struct2 const, struct2> > > x;
     };
     struct struct3 {
         boost::unordered_set<struct3, hash, equals,
- malloc_allocator<struct3> > x;
+ allocator<struct3> > x;
     };
     struct struct4 {
         boost::unordered_multiset<struct4, hash, equals,
- malloc_allocator<struct4> > x;
+ allocator<struct4> > x;
     };
     
     // Now define the value type.
@@ -83,15 +87,15 @@
 
     // Create some instances.
     
- test::map m1;
- test::multimap m2;
- test::set s1;
- test::multiset s2;
-
- test::struct1 c1;
- test::struct2 c2;
- test::struct3 c3;
- test::struct4 c4;
+ incomplete_test::map m1;
+ incomplete_test::multimap m2;
+ incomplete_test::set s1;
+ incomplete_test::multiset s2;
+
+ incomplete_test::struct1 c1;
+ incomplete_test::struct2 c2;
+ incomplete_test::struct3 c3;
+ incomplete_test::struct4 c4;
 
     // Now declare, but don't define, the operators required for comparing
     // elements.
@@ -113,7 +117,7 @@
     
     void use_types()
     {
- test::value x;
+ incomplete_test::value x;
         m1[x] = x;
         m2.insert(std::make_pair(x, x));
         s1.insert(x);
@@ -145,5 +149,5 @@
     // This could just be a compile test, but I like to be able to run these
     // things. It's probably irrational, but I find it reassuring.
 
- test::use_types();
+ incomplete_test::use_types();
 }

Modified: branches/release/libs/unordered/test/unordered/minimal_allocator.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/minimal_allocator.cpp (original)
+++ branches/release/libs/unordered/test/unordered/minimal_allocator.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -3,10 +3,10 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#include <boost/unordered/detail/allocator_helpers.hpp>
+#include <boost/unordered/detail/allocate.hpp>
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/type_traits/is_same.hpp>
-#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
 #include "../objects/test.hpp"
 
 template <class Tp>
@@ -41,22 +41,22 @@
     typedef boost::unordered::detail::allocator_traits<
         SimpleAllocator<T> > traits;
 
- BOOST_MPL_ASSERT((boost::is_same<typename traits::allocator_type, SimpleAllocator<T> >));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::allocator_type, SimpleAllocator<T> >::value));
 
- BOOST_MPL_ASSERT((boost::is_same<typename traits::value_type, T>));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::value_type, T>::value));
 
- BOOST_MPL_ASSERT((boost::is_same<typename traits::pointer, T* >));
- BOOST_MPL_ASSERT((boost::is_same<typename traits::const_pointer, T const*>));
- //BOOST_MPL_ASSERT((boost::is_same<typename traits::void_pointer, void* >));
- //BOOST_MPL_ASSERT((boost::is_same<typename traits::const_void_pointer, void const*>));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::pointer, T* >::value));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::const_pointer, T const*>::value));
+ //BOOST_STATIC_ASSERT((boost::is_same<typename traits::void_pointer, void* >::value));
+ //BOOST_STATIC_ASSERT((boost::is_same<typename traits::const_void_pointer, void const*>::value));
 
- BOOST_MPL_ASSERT((boost::is_same<typename traits::difference_type, std::ptrdiff_t>));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::difference_type, std::ptrdiff_t>::value));
 
 #if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS == 1
- BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type,
- std::make_unsigned<std::ptrdiff_t>::type>));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::size_type,
+ std::make_unsigned<std::ptrdiff_t>::type>::value));
 #else
- BOOST_MPL_ASSERT((boost::is_same<typename traits::size_type, std::size_t>));
+ BOOST_STATIC_ASSERT((boost::is_same<typename traits::size_type, std::size_t>::value));
 #endif
 
     BOOST_TEST(!traits::propagate_on_container_copy_assignment::value);

Modified: branches/release/libs/unordered/test/unordered/move_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/move_tests.cpp (original)
+++ branches/release/libs/unordered/test/unordered/move_tests.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -162,12 +162,12 @@
 #elif defined(BOOST_HAS_NRVO)
             BOOST_TEST(
                 test::global_object_count.constructions - count.constructions <=
- (test::is_map<T>::value ? 50 : 25));
+ (test::is_set<T>::value ? 25 : 50));
             BOOST_TEST(count.instances == test::global_object_count.instances);
 #else
             BOOST_TEST(
                 test::global_object_count.constructions - count.constructions <=
- (test::is_map<T>::value ? 100 : 50));
+ (test::is_set<T>::value ? 50 : 100));
             BOOST_TEST(count.instances == test::global_object_count.instances);
 #endif
             test::check_container(y, v);

Modified: branches/release/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- branches/release/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ branches/release/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2012-07-15 19:44:41 EDT (Sun, 15 Jul 2012)
@@ -11,23 +11,6 @@
 #include <iostream>
 #include "../helpers/test.hpp"
 
-#if defined(BOOST_UNORDERED_VARIADIC_MOVE)
-# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
-# elif defined(_LIBCPP_VERSION)
-# define BOOST_UNORDERED_VARIADIC_MOVE
-# elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
-# if defined(__GLIBCXX__) && __GLIBCXX__ >= 20090804
-# define BOOST_UNORDERED_VARIADIC_MOVE
-# endif
-# elif defined(__STL_CONFIG_H)
-# elif defined(__MSL_CPP__)
-# elif defined(__IBMCPP__)
-# elif defined(MSIPL_COMPILE_H)
-# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
-# endif
-#endif
-
 namespace unnecessary_copy_tests
 {
     struct count_copies
@@ -262,7 +245,7 @@
         // the existing element.
         reset();
         x.emplace();
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
         // source_cost doesn't make much sense here, but it seems to fit.
         COPY_COUNT(1); MOVE_COUNT(source_cost);
 #else


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