From 395c744d6fb00bfd5beac6f024dd6c4d4f26e70a Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 29 Aug 2011 11:10:09 +0000 Subject: [PATCH] Unordered: More portability changes. [SVN r74122] --- .../unordered/detail/allocator_helpers.hpp | 4 +++- include/boost/unordered/detail/buckets.hpp | 19 ++++++++++--------- .../boost/unordered/detail/extract_key.hpp | 4 ---- test/unordered/minimal_allocator.cpp | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/include/boost/unordered/detail/allocator_helpers.hpp b/include/boost/unordered/detail/allocator_helpers.hpp index fe1bce7d..e1caf87c 100644 --- a/include/boost/unordered/detail/allocator_helpers.hpp +++ b/include/boost/unordered/detail/allocator_helpers.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #if (defined(BOOST_NO_STD_ALLOCATOR) || defined(BOOST_DINKUMWARE_STDLIB)) \ && !defined(__BORLANDC__) @@ -83,7 +84,8 @@ namespace boost { namespace unordered { namespace detail { }; # endif - template T& make(); + template BOOST_DEDUCED_TYPENAME + boost::add_lvalue_reference::type make(); struct choice9 { typedef char (&type)[9]; }; struct choice8 : choice9 { typedef char (&type)[8]; }; struct choice7 : choice8 { typedef char (&type)[7]; }; diff --git a/include/boost/unordered/detail/buckets.hpp b/include/boost/unordered/detail/buckets.hpp index 6596c97b..35a9332d 100644 --- a/include/boost/unordered/detail/buckets.hpp +++ b/include/boost/unordered/detail/buckets.hpp @@ -668,10 +668,10 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std::tr1) class T, \ BOOST_UNORDERED_TEMPLATE_ARGS(z, num_params) \ > \ - inline void construct_impl( \ - BOOST_DEDUCED_TYPENAME \ - boost::disable_if, void*>::type \ - address, \ + inline BOOST_DEDUCED_TYPENAME \ + boost::disable_if >::type \ + construct_impl( \ + void* address, \ BOOST_UNORDERED_FUNCTION_PARAMS(z, num_params) \ ) \ { \ @@ -686,11 +686,12 @@ BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, std::tr1) template \ - inline void construct_impl( \ - BOOST_DEDUCED_TYPENAME \ - boost::enable_if, void*>::type \ - address, \ - Key const& k, BOOST_UNORDERED_FUNCTION_PARAMS(z, num_params)) \ + inline BOOST_DEDUCED_TYPENAME \ + boost::enable_if >::type \ + construct_impl( \ + void* address, \ + BOOST_FWD_REF(Key) k, \ + BOOST_UNORDERED_FUNCTION_PARAMS(z, num_params)) \ { \ new(address) T(k, \ BOOST_DEDUCED_TYPENAME \ diff --git a/include/boost/unordered/detail/extract_key.hpp b/include/boost/unordered/detail/extract_key.hpp index a412e6bc..d65e514f 100644 --- a/include/boost/unordered/detail/extract_key.hpp +++ b/include/boost/unordered/detail/extract_key.hpp @@ -165,10 +165,6 @@ namespace detail { } #endif - choice1::type is_key_test(key_type const&); - template - choice2::type is_key_test(T const&); - #if defined(BOOST_UNORDERED_STD_FORWARD_MOVE) #define BOOST_UNORDERED_KEY_FROM_TUPLE(namespace_) \ diff --git a/test/unordered/minimal_allocator.cpp b/test/unordered/minimal_allocator.cpp index e58c9318..7904ae9f 100644 --- a/test/unordered/minimal_allocator.cpp +++ b/test/unordered/minimal_allocator.cpp @@ -86,4 +86,4 @@ int main() test_simple_allocator(); return boost::report_errors(); -} \ No newline at end of file +}