Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65531 - trunk/boost/type_traits
From: john_at_[hidden]
Date: 2010-09-22 04:47:57


Author: johnmaddock
Date: 2010-09-22 04:47:55 EDT (Wed, 22 Sep 2010)
New Revision: 65531
URL: http://svn.boost.org/trac/boost/changeset/65531

Log:
Change these two traits to always use a static constant and not BOOST_STATIC_CONSTANT - otherwise they don't work!
Refs #4669.
Text files modified:
   trunk/boost/type_traits/is_signed.hpp | 11 ++++++++---
   trunk/boost/type_traits/is_unsigned.hpp | 11 ++++++++---
   2 files changed, 16 insertions(+), 6 deletions(-)

Modified: trunk/boost/type_traits/is_signed.hpp
==============================================================================
--- trunk/boost/type_traits/is_signed.hpp (original)
+++ trunk/boost/type_traits/is_signed.hpp 2010-09-22 04:47:55 EDT (Wed, 22 Sep 2010)
@@ -24,14 +24,19 @@
 
 namespace detail{
 
-#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
+#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
 
 template <class T>
 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<T>::type no_cv_t;
- BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1)));
- BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0)));
+ static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
+ static const no_cv_t zero = (static_cast<no_cv_t>(0));
 };
 
 template <class T>

Modified: trunk/boost/type_traits/is_unsigned.hpp
==============================================================================
--- trunk/boost/type_traits/is_unsigned.hpp (original)
+++ trunk/boost/type_traits/is_unsigned.hpp 2010-09-22 04:47:55 EDT (Wed, 22 Sep 2010)
@@ -24,14 +24,19 @@
 
 namespace detail{
 
-#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
+#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
 
 template <class T>
 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<T>::type no_cv_t;
- BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1)));
- BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0)));
+ static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
+ static const no_cv_t zero = (static_cast<no_cv_t>(0));
 };
 
 template <class T>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk