Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64834 - sandbox/chrono/boost/type_traits
From: vicente.botet_at_[hidden]
Date: 2010-08-15 14:53:10


Author: viboes
Date: 2010-08-15 14:53:07 EDT (Sun, 15 Aug 2010)
New Revision: 64834
URL: http://svn.boost.org/trac/boost/changeset/64834

Log:
Added BOOST_COMMON_TYPE_DONT_USE_TYPEOF which is undefined by default
Text files modified:
   sandbox/chrono/boost/type_traits/common_type.hpp | 9 ++++++---
   1 files changed, 6 insertions(+), 3 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-15 14:53:07 EDT (Sun, 15 Aug 2010)
@@ -124,7 +124,10 @@
     private:
         BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T));
         BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U));
-
+ static bool declval_bool(); // workaround gcc bug; not required by std
+ static typename add_rvalue_reference_helper<T>::type declval_T(); // workaround gcc bug; not required by std
+ static typename add_rvalue_reference_helper<U>::type declval_U(); // workaround gcc bug; not required by std
+
 #if !defined(BOOST_NO_DECLTYPE)
     public:
         typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
@@ -135,13 +138,13 @@
         static no deduce(U);
     public:
         typedef typename mpl::if_c<
- sizeof( deduce(declval<bool>() ? declval<T>() : declval<U>()) ) == sizeof( yes ),
+ sizeof( deduce( declval_bool() ? declval_T() : declval_U() ) ) == sizeof( yes ),
             T,
             U
>::type type;
 #else
     public:
- typedef BOOST_TYPEOF_TPL(declval<bool>() ? declval<T>() : declval<U>()) type;
+ typedef BOOST_TYPEOF_TPL(declval_bool() ? declval_T() : declval_U()) type;
 #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