From 710d73bed8af2877b1b29db5772084f4a04b6fda Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 3 Feb 2005 13:54:18 +0000 Subject: [PATCH] Fix for old and broken EDG compilers [SVN r27055] --- include/boost/type_traits/is_signed.hpp | 42 ++++++++++++++++++ include/boost/type_traits/is_unsigned.hpp | 53 ++++++++++++++++++++--- 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 56522c4..bff6fee 100755 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -21,6 +21,8 @@ namespace boost { namespace detail{ +#if (defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) + template struct is_signed_helper { @@ -64,6 +66,46 @@ struct is_signed_imp #endif }; +#else + +template struct is_signed_imp : public false_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +#ifdef BOOST_HAS_LONG_LONG +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +#endif +#if defined(CHAR_MIN) && (CHAR_MIN != 0) +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +#endif +#if defined(WCHAR_MIN) && (WCHAR_MIN != 0) +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +template <> struct is_signed_imp : public true_type{}; +#endif + +#endif + } BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_signed,T,::boost::detail::is_signed_imp::value) diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index fd71611..68fb230 100755 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -21,24 +21,26 @@ namespace boost { namespace detail{ +#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) + template -struct is_unsigned_helper +struct is_ununsigned_helper { BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) > 0)); }; template -struct is_unsigned_select_helper +struct is_ununsigned_select_helper { template struct rebind { - typedef is_unsigned_helper type; + typedef is_ununsigned_helper type; }; }; template <> -struct is_unsigned_select_helper +struct is_ununsigned_select_helper { template struct rebind @@ -50,7 +52,7 @@ struct is_unsigned_select_helper template struct is_unsigned_imp { - typedef is_unsigned_select_helper< + typedef is_ununsigned_select_helper< ::boost::type_traits::ice_or< ::boost::is_integral::value, ::boost::is_enum::value>::value @@ -60,6 +62,47 @@ struct is_unsigned_imp BOOST_STATIC_CONSTANT(bool, value = type::value); }; +#else + +template struct is_unsigned_imp : public false_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +#ifdef BOOST_HAS_LONG_LONG +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +#endif +#if defined(CHAR_MIN) && (CHAR_MIN == 0) +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +#endif +#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +template <> struct is_unsigned_imp : public true_type{}; +#endif + +#endif + + } BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp::value)