From 0081a5017d4e75da79a843cc3c18110e8b99092a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 16 Dec 2003 11:14:17 +0000 Subject: [PATCH] Previous version of integral_constant broke on any number of compilers, should now be fixed. [SVN r21283] --- .../type_traits/detail/bool_trait_def.hpp | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp index b6f7d86..d6b0e36 100644 --- a/include/boost/type_traits/detail/bool_trait_def.hpp +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -152,6 +152,7 @@ template< param > struct trait##_impl< sp1,sp2 > \ #ifndef BOOST_TT_INTEGRAL_CONSTANT #define BOOST_TT_INTEGRAL_CONSTANT +#include // // this is not a TR1 conforming integral_constant, @@ -162,14 +163,21 @@ namespace boost{ template struct integral_constant -{ - typedef T value_type; - typedef integral_constant type; - BOOST_STATIC_CONSTANT(value_type, value = val); -}; +: public mpl::integral_c {}; -BOOST_TT_AUX_BOOL_TRAIT_SPEC2(integral_constant, bool, true, true); -BOOST_TT_AUX_BOOL_TRAIT_SPEC2(integral_constant, bool, false, false); + +template<> struct integral_constant< bool, true > \ + BOOST_TT_AUX_BOOL_C_BASE(true) \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,integral_constant,(bool)) \ +}; +template<> struct integral_constant< bool, false > \ + BOOST_TT_AUX_BOOL_C_BASE(false) \ +{ \ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(false) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,integral_constant,(bool)) \ +}; typedef integral_constant true_type; typedef integral_constant false_type;