Boost logo

Boost :

From: Thomas Matelich (matelich_at_[hidden])
Date: 2007-02-16 18:50:53


Finally trying out 1.34, and had 1 problem so far using current cvs
for RC_1_34_0.

For this code:

      retval = boost::io::str( //line 424
         boost::format("%s%4.1f/%s%4.1f")
            % tests[0].from_lm
            % tests[0].from_offset
            % tests[0].to_lm
            % tests[0].to_offset );

with those members accessed being:
    char from_lm[16];
    float from_offset;

    char to_lm[16];
    float to_offset;

I got the attached compiler errors from VS 2005 (no SP1). I fixed it
with the changes below, but I haven't been able to test the execution
yet, I assume it will work fine. I probably could have fixed it by
converting from_lm and to_lm to std::strings on the way in, but the
<size_type> seemed more correct. This would be a regression from my
previous 1.32.1 boost.

I'm pretty surprised surprised so far, Boost upgrades usually aren't
this painless, though I've got another 6 hours of compiling to do.
Not to mention the other platforms.

Index: boost/format/feed_args.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/format/feed_args.hpp,v
retrieving revision 1.28.6.2
diff -u -w -r1.28.6.2 feed_args.hpp
--- boost/format/feed_args.hpp 19 Jun 2006 06:15:12 -0000 1.28.6.2
+++ boost/format/feed_args.hpp 16 Feb 2007 23:09:12 -0000
@@ -156,7 +156,7 @@
                 if(buf.pcount()== 0 ||
                    (res_beg[0] !=oss.widen('+') && res_beg[0]
!=oss.widen('-') ))
                     prefix_space = oss.widen(' ');
- size_type res_size = (std::min)(
+ size_type res_size = std::min<size_type>(
                 static_cast<size_type>(specs.truncate_ - !!prefix_space),
                 buf.pcount() );
             mk_str(res, res_beg, res_size, w, oss.fill(), fl,
@@ -201,7 +201,7 @@
                 }
                 // we now have the minimal-length output
                 const Ch * tmp_beg = buf.pbase();
- size_type tmp_size =
(std::min)(static_cast<size_type>(specs.truncate_),
+ size_type tmp_size =
std::min<size_type>(static_cast<size_type>(specs.truncate_),
                                                 buf.pcount() );




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk