From dcdfca5f38ce4fea70d4426fdd9dec88a1ed2c01 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 12 Jul 2009 16:11:26 +0000 Subject: [PATCH] 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 [SVN r54911] --- include/boost/integer/static_log2.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/integer/static_log2.hpp b/include/boost/integer/static_log2.hpp index 19e048b..219a48e 100644 --- a/include/boost/integer/static_log2.hpp +++ b/include/boost/integer/static_log2.hpp @@ -48,7 +48,7 @@ namespace boost { template 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 @@ namespace boost { template 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)