Index: integral_promotion.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/type_traits/integral_promotion.hpp,v retrieving revision 1.1 diff -u -r1.1 integral_promotion.hpp --- integral_promotion.hpp 16 Apr 2006 00:22:36 -0000 1.1 +++ integral_promotion.hpp 25 May 2006 17:00:35 -0000 @@ -10,9 +10,11 @@ #include #include +#include #include #include #include +#include // Should be the last #include #include @@ -23,21 +25,23 @@ namespace type_traits { namespace detail { // 4.5/2 -BOOST_TT_AUX_BOOL_TRAIT_DEF1(need_promotion, T, boost::is_enum::value) +template +struct need_promotion : boost::is_enum {}; // 4.5/1 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned char , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, signed short int , true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, unsigned short int, true) +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; +template<> struct need_promotion : true_type {}; // Specializations for non-standard types. // Type is promoted if it's smaller then int. #define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \ - BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, T, (sizeof(T) < sizeof(int))) + template<> struct need_promotion \ + : integral_constant {}; // Same set of integral types as in boost/type_traits/is_integral.hpp. // Please, keep in sync. @@ -70,13 +74,13 @@ #ifndef BOOST_NO_INTRINSIC_WCHAR_T // 4.5/2 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, wchar_t, true) +template<> struct need_promotion : true_type {}; #endif // 4.5/3 (integral bit-field) is not supported. // 4.5/4 -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(need_promotion, bool, true) +template<> struct need_promotion : true_type {}; // Get promoted type by index and cv qualifiers. @@ -170,7 +174,7 @@ template struct integral_promotion : boost::mpl::eval_if< - need_promotion + need_promotion::type> , integral_promotion_impl , boost::mpl::identity >