Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65076 - sandbox/chrono/boost/type_traits
From: vicente.botet_at_[hidden]
Date: 2010-08-28 04:26:23


Author: viboes
Date: 2010-08-28 04:26:18 EDT (Sat, 28 Aug 2010)
New Revision: 65076
URL: http://svn.boost.org/trac/boost/changeset/65076

Log:
Towards implementing common_type without Typeof support
eliminate ;; -pedantic warning
define error message when !defined(BOOST_NO_STATIC_ASSERT)

Text files modified:
   sandbox/chrono/boost/type_traits/common_type.hpp | 18 +++++++++++-------
   1 files changed, 11 insertions(+), 7 deletions(-)

Modified: sandbox/chrono/boost/type_traits/common_type.hpp
==============================================================================
--- sandbox/chrono/boost/type_traits/common_type.hpp (original)
+++ sandbox/chrono/boost/type_traits/common_type.hpp 2010-08-28 04:26:18 EDT (Sat, 28 Aug 2010)
@@ -36,12 +36,12 @@
 #elif defined(BOOST_COMMON_TYPE_USES_ARRAY_ASSERT)
 #define BOOST_COMMON_TYPE_CONCAT(A,B) A##B
 #define BOOST_COMMON_TYPE_NAME(A,B) BOOST_COMMON_TYPE_CONCAT(A,B)
-#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_COMMON_TYPE_NAME(__boost_common_type_test_,__LINE__)[CND];
+#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_COMMON_TYPE_NAME(__boost_common_type_test_,__LINE__)[CND]
 #else
 #define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES)
 #endif
 
-#if !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
+#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
 #define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type"
 #endif
 
@@ -140,6 +140,7 @@
     public:
         typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
 #elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
+#if 0
         typedef char (&yes)[1];
         typedef char (&no)[2];
         //~ static yes deduce(typename add_rvalue_reference_helper<T>::type);
@@ -154,6 +155,13 @@
>::type type;
 #else
     public:
+ typedef typename detail_type_traits_common_type::common_type_impl<
+ typename remove_cv<T>::type,
+ typename remove_cv<U>::type
+ >::type type;
+#endif
+#else
+ public:
         typedef BOOST_TYPEOF_TPL(declval_bool() ? declval_T() : declval_U()) type;
 #endif
     };
@@ -172,11 +180,7 @@
     template <class T, class U>
     struct common_type<T, U, void>
 #endif
- //~ : type_traits_detail::common_type_2<T,U>
- : detail_type_traits_common_type::common_type_impl<
- typename remove_cv<T>::type,
- typename remove_cv<U>::type
- >
+ : type_traits_detail::common_type_2<T,U>
     { };
 
 


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