From 82af891892ac1ccbebb313e02342617fbdfcd89d Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Tue, 6 Feb 2001 01:21:11 +0000 Subject: [PATCH] ported to KAI C++ [SVN r8955] --- include/boost/detail/numeric_traits.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/boost/detail/numeric_traits.hpp b/include/boost/detail/numeric_traits.hpp index 9701ec6..f87893c 100644 --- a/include/boost/detail/numeric_traits.hpp +++ b/include/boost/detail/numeric_traits.hpp @@ -94,7 +94,11 @@ namespace boost { namespace detail { template struct is_signed { - enum { value = (Number(-1) < Number(0)) }; +#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) + enum { value = (Number(-1) < Number(0)) }; +#else + enum { value = std::numeric_limits::is_signed }; +#endif }; # ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS @@ -156,16 +160,16 @@ namespace boost { namespace detail { # endif public: typedef typename - if_true<(x::is_signed - && (!x::is_bounded + if_true<(!int(x::is_signed) + && (!int(x::is_bounded) // digits is the number of no-sign bits - || (x::digits + 1 >= digit_traits::digits)))>::template then< + || (int(x::digits) + 1 >= digit_traits::digits)))>::template then< Integer, - typename if_true<(x::digits + 1 < digit_traits::digits)>::template then< + typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< signed int, - typename if_true<(x::digits + 1 < digit_traits::digits)>::template then< + typename if_true<(int(x::digits) + 1 < digit_traits::digits)>::template then< signed long, // else