Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54911 - in branches/release: . boost/integer
From: daniel_james_at_[hidden]
Date: 2009-07-12 12:11:27


Author: danieljames
Date: 2009-07-12 12:11:26 EDT (Sun, 12 Jul 2009)
New Revision: 54911
URL: http://svn.boost.org/trac/boost/changeset/54911

Log:
Use BOOST_STATIC_CONSTANT in static_log2, as g++ 4.0 has problems with enum.

Merged revisions 54811 via svnmerge from
https://svn.boost.org/svn/boost/trunk

Properties modified:
   branches/release/ (props changed)
Text files modified:
   branches/release/boost/integer/static_log2.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: branches/release/boost/integer/static_log2.hpp
==============================================================================
--- branches/release/boost/integer/static_log2.hpp (original)
+++ branches/release/boost/integer/static_log2.hpp 2009-07-12 12:11:26 EDT (Sun, 12 Jul 2009)
@@ -48,7 +48,7 @@
      template <result_type n>
      struct choose_initial_n {
 
- enum { c = (argument_type(1) << n << n) != 0 };
+ BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0);
          BOOST_STATIC_CONSTANT(
              result_type,
              value = !c*n + choose_initial_n<2*c*n>::value
@@ -85,7 +85,7 @@
      template <argument_type x, result_type n = initial_n>
      struct static_log2_impl {
 
- enum { c = (x >> n) > 0 }; // x >= 2**n ?
+ BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ?
          BOOST_STATIC_CONSTANT(
              result_type,
              value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value)


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