Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80325 - trunk/boost/type_traits
From: mimomorin_at_[hidden]
Date: 2012-08-30 23:30:52


Author: michel
Date: 2012-08-30 23:30:51 EDT (Thu, 30 Aug 2012)
New Revision: 80325
URL: http://svn.boost.org/trac/boost/changeset/80325

Log:
Fix preprocessor usage (and synchronize the style); fixes #7306
Text files modified:
   trunk/boost/type_traits/is_convertible.hpp | 33 ++++++++++++++++++++++-----------
   1 files changed, 22 insertions(+), 11 deletions(-)

Modified: trunk/boost/type_traits/is_convertible.hpp
==============================================================================
--- trunk/boost/type_traits/is_convertible.hpp (original)
+++ trunk/boost/type_traits/is_convertible.hpp 2012-08-30 23:30:51 EDT (Thu, 30 Aug 2012)
@@ -137,11 +137,12 @@
     typedef typename add_lvalue_reference<From>::type lvalue_type;
     typedef typename add_rvalue_reference<From>::type rvalue_type;
     static lvalue_type _m_from;
- static bool const value =
 #if !defined(BOOST_NO_RVALUE_REFERENCES) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)))
+ static bool const value =
         sizeof( boost::detail::checker<To>::_m_check(static_cast<rvalue_type>(_m_from), 0) )
         == sizeof(::boost::type_traits::yes_type);
 #else
+ static bool const value =
         sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )
         == sizeof(::boost::type_traits::yes_type);
 #endif
@@ -178,13 +179,15 @@
     typedef typename add_rvalue_reference<From>::type rvalue_type;
     static lvalue_type _m_from;
 
- BOOST_STATIC_CONSTANT(bool, value =
 #ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(static_cast<rvalue_type>(_m_from), 0) ) == sizeof(::boost::type_traits::yes_type)
+ );
 #else
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from, 0) ) == sizeof(::boost::type_traits::yes_type)
-#endif
         );
+#endif
 };
 
 #elif defined(__DMC__)
@@ -212,13 +215,15 @@
 
     // Static constants sometime cause the conversion of _m_from to To to be
     // called. This doesn't happen with an enum.
- enum { value =
 #ifndef BOOST_NO_RVALUE_REFERENCES
+ enum { value =
         sizeof( _m_check(static_cast<rvalue_type>(_m_from), 0, 0) ) == sizeof(::boost::type_traits::yes_type)
+ };
 #else
+ enum { value =
         sizeof( _m_check(_m_from, 0, 0) ) == sizeof(::boost::type_traits::yes_type)
-#endif
         };
+#endif
 };
 
 #elif defined(__MWERKS__)
@@ -249,13 +254,15 @@
     typedef typename add_rvalue_reference<From>::type rvalue_type;
     static lvalue_type _m_from;
 
- BOOST_STATIC_CONSTANT(bool, value =
 #ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(static_cast<rvalue_type>(_m_from), 0) ) == sizeof(::boost::type_traits::yes_type)
+ );
 #else
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from, 0) ) == sizeof(::boost::type_traits::yes_type)
-#endif
         );
+#endif
 };
 
 template <typename From, typename To>
@@ -266,13 +273,15 @@
     typedef typename add_lvalue_reference<From>::type lvalue_type;
     typedef typename add_rvalue_reference<From>::type rvalue_type;
     static lvalue_type _m_from;
- BOOST_STATIC_CONSTANT(bool, value =
 #ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(static_cast<rvalue_type>(_m_from)) ) == sizeof(::boost::type_traits::yes_type)
+ );
 #else
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type)
-#endif
         );
+#endif
 };
 
 template <typename From, typename To>
@@ -303,13 +312,15 @@
 #pragma warning(disable:6334)
 #endif
 #endif
- BOOST_STATIC_CONSTANT(bool, value =
 #ifndef BOOST_NO_RVALUE_REFERENCES
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(static_cast<rvalue_type>(_m_from)) ) == sizeof(::boost::type_traits::yes_type)
+ );
 #else
+ BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type)
-#endif
         );
+#endif
 #ifdef BOOST_MSVC
 #pragma warning(pop)
 #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