Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77972 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2012-04-14 13:32:29


Author: danieljames
Date: 2012-04-14 13:32:28 EDT (Sat, 14 Apr 2012)
New Revision: 77972
URL: http://svn.boost.org/trac/boost/changeset/77972

Log:
Unordered: Rejig some of the emplace_args macro code. Refs #6784

This is a bit cleaner and will hopefully fix the Sun problems.
Text files modified:
   trunk/boost/unordered/detail/emplace_args.hpp | 60 ++++++++++++++++++++-------------------
   1 files changed, 31 insertions(+), 29 deletions(-)

Modified: trunk/boost/unordered/detail/emplace_args.hpp
==============================================================================
--- trunk/boost/unordered/detail/emplace_args.hpp (original)
+++ trunk/boost/unordered/detail/emplace_args.hpp 2012-04-14 13:32:28 EDT (Sat, 14 Apr 2012)
@@ -160,9 +160,9 @@
     //
     // Used for piecewise construction.
 
-#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
+#if !defined(__SUNPRO_CC)
 
-#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
+# define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(n, namespace_) \
     template<typename T> \
     void construct_from_tuple(T* ptr, namespace_::tuple<>) \
     { \
@@ -172,7 +172,7 @@
     BOOST_PP_REPEAT_FROM_TO(1, n, \
         BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, namespace_)
 
-#define BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL(z, n, 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) \
@@ -182,32 +182,26 @@
         ); \
     }
 
-#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
+# define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, namespace_) \
     namespace_::get<n>(x)
 
-BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE(10, boost)
-
-#if !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
-
 #else
 
     template <int N> struct length {};
 
- template<typename T>
- void construct_from_tuple_impl(
- boost::unordered::detail::length<0>, T* ptr,
- boost::tuple<>)
- {
- new ((void*) ptr) T();
- }
+# 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, _) \
+# 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, \
@@ -218,11 +212,22 @@
         ); \
     }
 
-#define BOOST_UNORDERED_GET_TUPLE_ARG(z, n, _) \
- boost::get<n>(x)
+# 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
 
- BOOST_PP_REPEAT_FROM_TO(1, 10, \
- BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL, _)
+#if defined(__SUNPRO_CC)
 
     template <typename T, typename Tuple>
     void construct_from_tuple(T* ptr, Tuple const& x)
@@ -233,9 +238,6 @@
             ptr, x);
     }
 
-#undef BOOST_UNORDERED_CONSTRUCT_FROM_TUPLE_IMPL
-#undef BOOST_UNORDERED_GET_TUPLE_ARG
-
 #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