|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74799 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2011-10-08 08:17:10
Author: danieljames
Date: 2011-10-08 08:17:09 EDT (Sat, 08 Oct 2011)
New Revision: 74799
URL: http://svn.boost.org/trac/boost/changeset/74799
Log:
Unordered: Just do member detection on older compilers.
Text files modified:
trunk/boost/unordered/detail/allocator_helpers.hpp | 65 ++++++---------------------------------
1 files changed, 11 insertions(+), 54 deletions(-)
Modified: trunk/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocator_helpers.hpp (original)
+++ trunk/boost/unordered/detail/allocator_helpers.hpp 2011-10-08 08:17:09 EDT (Sat, 08 Oct 2011)
@@ -109,8 +109,7 @@
#if !defined(BOOST_NO_SFINAE_EXPR) || BOOST_WORKAROUND(BOOST_MSVC, >= 1500)
-# define BOOST_UNORDERED_HAVE_CALL_0_DETECTION 1
-# define BOOST_UNORDERED_HAVE_CALL_N_DETECTION 1
+# define BOOST_UNORDERED_HAVE_CALL_DETECTION 1
template <typename T, unsigned int> struct expr_test;
template <typename T> struct expr_test<T, sizeof(char)> : T {};
@@ -142,9 +141,7 @@
#else
-# define BOOST_UNORDERED_HAVE_CALL_0_DETECTION 0
-# define BOOST_UNORDERED_HAVE_CALL_N_DETECTION \
- !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x5100))
+# define BOOST_UNORDERED_HAVE_CALL_DETECTION 0
template <typename T> struct identity { typedef T type; };
@@ -166,7 +163,7 @@
template <class U> static BOOST_PP_CAT(choice, result)::type \
test(BOOST_PP_CAT(choice, count))
-#define BOOST_UNORDERED_WRAP_PARAMATERS(z, n, data) convert_from_anything
+#define BOOST_UNORDERED_WRAP_PARAMATERS(z, n, data) congert_from_anything
#define BOOST_UNORDERED_HAS_MEMBER(name) \
struct BOOST_PP_CAT(has_, name) \
@@ -182,44 +179,6 @@
}; \
}
-#define BOOST_UNORDERED_HAS_FUNCTION(name, thing, args, arg_count) \
- struct BOOST_PP_CAT(has_, name) \
- { \
- struct base_mixin { void name(); }; \
- struct base : public T, public base_mixin {}; \
- \
- BOOST_UNORDERED_CHECK_MEMBER(1, 1, name, void (base_mixin::*)()); \
- BOOST_UNORDERED_DEFAULT_MEMBER(2, 2); \
- \
- enum { has_member = sizeof(choice2::type) == \
- sizeof(test<base>(choose())) \
- }; \
- \
- template <typename U> \
- struct wrap : U \
- { \
- using U::name; \
- private_type name( \
- BOOST_PP_ENUM(arg_count, BOOST_UNORDERED_WRAP_PARAMATERS, _) \
- ); \
- }; \
- \
- template <typename U> \
- struct impl \
- { \
- enum { value = sizeof( \
- boost::unordered::detail::is_private_type(( \
- boost::unordered::detail::make<wrap< thing > >() \
- .name args \
- , 0))) == sizeof(yes_type) }; \
- }; \
- \
- enum { value = \
- boost::detail::if_true<has_member>:: \
- BOOST_NESTED_TEMPLATE then<impl<T>, false_type>::type::value \
- }; \
- }
-
#endif
////////////////////////////////////////////////////////////////////////////
@@ -311,7 +270,7 @@
BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment);
BOOST_UNORDERED_DEFAULT_TYPE_TMPLT(propagate_on_container_swap);
-#if BOOST_UNORDERED_HAVE_CALL_0_DETECTION
+#if BOOST_UNORDERED_HAVE_CALL_DETECTION
template <typename T>
BOOST_UNORDERED_HAS_FUNCTION(
select_on_container_copy_construction, U const, (), 0
@@ -321,15 +280,7 @@
BOOST_UNORDERED_HAS_FUNCTION(
max_size, U const, (), 0
);
-#else
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(select_on_container_copy_construction);
-
- template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(max_size);
-#endif
-#if BOOST_UNORDERED_HAVE_CALL_N_DETECTION
template <typename T, typename ValueType>
BOOST_UNORDERED_HAS_FUNCTION(
construct, U, (
@@ -343,9 +294,15 @@
);
#else
template <typename T>
- BOOST_UNORDERED_HAS_MEMBER(construct);
+ 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
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