Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68457 - trunk/boost/spirit/home/karma/numeric
From: hartmut.kaiser_at_[hidden]
Date: 2011-01-26 13:03:48


Author: hkaiser
Date: 2011-01-26 13:03:45 EST (Wed, 26 Jan 2011)
New Revision: 68457
URL: http://svn.boost.org/trac/boost/changeset/68457

Log:
Spirit: fixing const correctness bug in Karma real_policies
Text files modified:
   trunk/boost/spirit/home/karma/numeric/real_policies.hpp | 4 +++-
   1 files changed, 3 insertions(+), 1 deletions(-)

Modified: trunk/boost/spirit/home/karma/numeric/real_policies.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/numeric/real_policies.hpp (original)
+++ trunk/boost/spirit/home/karma/numeric/real_policies.hpp 2011-01-26 13:03:45 EST (Wed, 26 Jan 2011)
@@ -12,6 +12,7 @@
 
 #include <boost/config/no_tr1/cmath.hpp>
 #include <boost/math/special_functions/fpclassify.hpp>
+#include <boost/type_traits/remove_const.hpp>
 
 #include <boost/spirit/home/support/char_class.hpp>
 #include <boost/spirit/home/karma/generator.hpp>
@@ -257,7 +258,8 @@
             // generate(sink, right_align(precision, '0')[ulong], n);
             // but it's spelled out to avoid inter-modular dependencies.
 
- T digits = (detail::is_zero(n) ? 0 : floor(log10(n))) + 1;
+ typename remove_const<T>::type digits =
+ (detail::is_zero(n) ? 0 : floor(log10(n))) + 1;
             bool r = true;
             for (/**/; r && digits < precision_; digits = digits + 1)
                 r = char_inserter<>::call(sink, '0');


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