Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68614 - sandbox/type_traits/boost/type_traits/detail
From: frederic.bron_at_[hidden]
Date: 2011-02-02 16:04:39


Author: bronf
Date: 2011-02-02 16:04:37 EST (Wed, 02 Feb 2011)
New Revision: 68614
URL: http://svn.boost.org/trac/boost/changeset/68614

Log:
use of BOOST_STATIC_CONST for operator traits
Text files modified:
   sandbox/type_traits/boost/type_traits/detail/has_binary_operator.hpp | 28 ++++++++++++----------------
   sandbox/type_traits/boost/type_traits/detail/has_postfix_operator.hpp | 20 ++++++++------------
   sandbox/type_traits/boost/type_traits/detail/has_prefix_operator.hpp | 20 ++++++++------------
   3 files changed, 28 insertions(+), 40 deletions(-)

Modified: sandbox/type_traits/boost/type_traits/detail/has_binary_operator.hpp
==============================================================================
--- sandbox/type_traits/boost/type_traits/detail/has_binary_operator.hpp (original)
+++ sandbox/type_traits/boost/type_traits/detail/has_binary_operator.hpp 2011-02-02 16:04:37 EST (Wed, 02 Feb 2011)
@@ -53,8 +53,7 @@
         };
         static ::boost::type_traits::yes_type returns_void(returns_void_t);
         static ::boost::type_traits::no_type returns_void(int);
- static bool const value=
- sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<LHS>() BOOST_TT_TRAIT_OP make<RHS>(),returns_void_t())));
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<LHS>() BOOST_TT_TRAIT_OP make<RHS>(),returns_void_t())))));
 };
 
 template < typename LHS, typename RHS, typename RET, typename RETURNS_VOID >
@@ -66,14 +65,13 @@
         static ::boost::type_traits::yes_type is_convertible_to_RET(RET); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type is_convertible_to_RET(...); // this version is used otherwise
 
- static const bool value=
- sizeof(is_convertible_to_RET(make<LHS>() BOOST_TT_TRAIT_OP make<RHS>()))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value=(sizeof(is_convertible_to_RET(make<LHS>() BOOST_TT_TRAIT_OP make<RHS>()))==sizeof(::boost::type_traits::yes_type)));
 };
 
 // LHS BOOST_TT_TRAIT_OP RHS returns void!=RET
 template < typename LHS, typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RHS, RET, ::boost::true_type > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename LHS, typename RHS, typename RET,
@@ -83,14 +81,13 @@
 
 template < typename LHS, typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < LHS, RHS, RET, true > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 // checks for return type if 3rd template parameter RET is non void
 template < typename LHS, typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < LHS, RHS, RET, false > {
- static const bool value=
- BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< LHS, RHS >::value > >::value;
+ BOOST_STATIC_CONSTANT(bool, value = (BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< LHS, RHS >::value > >::value));
 };
 
 // in case we do not want to check for return type
@@ -102,38 +99,37 @@
         static ::boost::type_traits::yes_type check(int); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type check(tag); // this version is used otherwise
 
- static const bool value=
- sizeof(check(((make<LHS>() BOOST_TT_TRAIT_OP make<RHS>()),0)))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<LHS>() BOOST_TT_TRAIT_OP make<RHS>()),0)))==sizeof(::boost::type_traits::yes_type)));
 };
 
 template < typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, RHS, RET, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename LHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< LHS, void, RET, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename LHS >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< LHS, void, void, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename RHS >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, RHS, void, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, void, RET, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template <>
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, void, void, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 } // namespace impl

Modified: sandbox/type_traits/boost/type_traits/detail/has_postfix_operator.hpp
==============================================================================
--- sandbox/type_traits/boost/type_traits/detail/has_postfix_operator.hpp (original)
+++ sandbox/type_traits/boost/type_traits/detail/has_postfix_operator.hpp 2011-02-02 16:04:37 EST (Wed, 02 Feb 2011)
@@ -52,8 +52,7 @@
         };
         static ::boost::type_traits::yes_type returns_void(returns_void_t);
         static ::boost::type_traits::no_type returns_void(int);
- static bool const value=
- sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<LHS>() BOOST_TT_TRAIT_OP,returns_void_t())));
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make<LHS>() BOOST_TT_TRAIT_OP,returns_void_t())))));
 };
 
 template < typename LHS, typename RET, typename RETURNS_VOID >
@@ -65,14 +64,13 @@
         static ::boost::type_traits::yes_type is_convertible_to_RET(RET); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type is_convertible_to_RET(...); // this version is used otherwise
 
- static const bool value=
- sizeof(is_convertible_to_RET(make<LHS>() BOOST_TT_TRAIT_OP))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_RET(make<LHS>() BOOST_TT_TRAIT_OP))==sizeof(::boost::type_traits::yes_type)));
 };
 
 // BOOST_TT_TRAIT_OP LHS returns void!=RET
 template < typename LHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RET, ::boost::true_type > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename LHS, typename RET,
@@ -82,14 +80,13 @@
 
 template < typename LHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < LHS, RET, true > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 // checks for return type if 2nd template parameter RET is non void
 template < typename LHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < LHS, RET, false > {
- static const bool value=
- BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< LHS >::value > >::value;
+ BOOST_STATIC_CONSTANT(bool, value = (BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< LHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< LHS >::value > >::value));
 };
 
 // in case we do not want to check for return type
@@ -101,18 +98,17 @@
         static ::boost::type_traits::yes_type check(int); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type check(tag); // this version is used otherwise
 
- static const bool value=
- sizeof(check(((make<LHS>() BOOST_TT_TRAIT_OP),0)))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make<LHS>() BOOST_TT_TRAIT_OP),0)))==sizeof(::boost::type_traits::yes_type)));
 };
 
 template < typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, RET, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template <>
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, void, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 } // namespace impl

Modified: sandbox/type_traits/boost/type_traits/detail/has_prefix_operator.hpp
==============================================================================
--- sandbox/type_traits/boost/type_traits/detail/has_prefix_operator.hpp (original)
+++ sandbox/type_traits/boost/type_traits/detail/has_prefix_operator.hpp 2011-02-02 16:04:37 EST (Wed, 02 Feb 2011)
@@ -53,8 +53,7 @@
         };
         static ::boost::type_traits::yes_type returns_void(returns_void_t);
         static ::boost::type_traits::no_type returns_void(int);
- static bool const value=
- sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((BOOST_TT_TRAIT_OP make<RHS>(),returns_void_t())));
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((BOOST_TT_TRAIT_OP make<RHS>(),returns_void_t())))));
 };
 
 template < typename RHS, typename RET, typename RETURNS_VOID >
@@ -66,14 +65,13 @@
         static ::boost::type_traits::yes_type is_convertible_to_RET(RET); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type is_convertible_to_RET(...); // this version is used otherwise
 
- static const bool value=
- sizeof(is_convertible_to_RET(BOOST_TT_TRAIT_OP make<RHS>()))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_RET(BOOST_TT_TRAIT_OP make<RHS>()))==sizeof(::boost::type_traits::yes_type)));
 };
 
 // BOOST_TT_TRAIT_OP RHS returns void!=RET
 template < typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< RHS, RET, ::boost::true_type > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template < typename RHS, typename RET,
@@ -83,14 +81,13 @@
 
 template < typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < RHS, RET, true > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 // checks for return type if 2nd template parameter RET is non void
 template < typename RHS, typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) < RHS, RET, false > {
- static const bool value=
- BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< RHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< RHS >::value > >::value;
+ BOOST_STATIC_CONSTANT(bool, value = (BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl1)< RHS, RET, typename ::boost::integral_constant< bool, BOOST_JOIN(BOOST_TT_TRAIT_NAME,_returns_void)< RHS >::value > >::value));
 };
 
 // in case we do not want to check for return type
@@ -102,18 +99,17 @@
         static ::boost::type_traits::yes_type check(int); // this version is preferred for types convertible to RET
         static ::boost::type_traits::no_type check(tag); // this version is used otherwise
 
- static const bool value=
- sizeof(check(((BOOST_TT_TRAIT_OP make<RHS>()),0)))==sizeof(::boost::type_traits::yes_type);
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((BOOST_TT_TRAIT_OP make<RHS>()),0)))==sizeof(::boost::type_traits::yes_type)));
 };
 
 template < typename RET >
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, RET, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 template <>
 struct BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)< void, void, false > {
- static const bool value=false;
+ BOOST_STATIC_CONSTANT(bool, value = false);
 };
 
 } // namespace impl


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