From edd98db5fbdd06dd932f5ea7ba895b074a9993ff Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 22 Sep 2010 08:47:55 +0000 Subject: [PATCH] Change these two traits to always use a static constant and not BOOST_STATIC_CONSTANT - otherwise they don't work! Refs #4669. [SVN r65531] --- include/boost/type_traits/is_signed.hpp | 11 ++++++++--- include/boost/type_traits/is_unsigned.hpp | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index bf7bbfd..ba7d6e9 100644 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -24,14 +24,19 @@ namespace boost { namespace detail{ -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) +#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) template struct is_signed_values { + // + // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's + // rather than "real" static constants simply doesn't work or give + // the correct answer. + // typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); - BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); + static const no_cv_t minus_one = (static_cast(-1)); + static const no_cv_t zero = (static_cast(0)); }; template diff --git a/include/boost/type_traits/is_unsigned.hpp b/include/boost/type_traits/is_unsigned.hpp index 98baf4e..d8e5a89 100644 --- a/include/boost/type_traits/is_unsigned.hpp +++ b/include/boost/type_traits/is_unsigned.hpp @@ -24,14 +24,19 @@ namespace boost { namespace detail{ -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) +#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) template struct is_unsigned_values { + // + // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's + // rather than "real" static constants simply doesn't work or give + // the correct answer. + // typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); - BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); + static const no_cv_t minus_one = (static_cast(-1)); + static const no_cv_t zero = (static_cast(0)); }; template