From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2007-03-04 09:38:40
> Consider the following example program:
> #include <boost/format.hpp>
> #include <cstdio>
> #include <string>
> int main()
> unsigned char n = 65;
> std::printf("%u\n", n);
> std::puts((boost::format("%u") % n).str().c_str());
> $ g++ test.cc
> $ ./a.out
> In my opinion this is a bug - both operations should produce "65".
See my previous report:
which continues at
The conclusion at that time was that
- you can just cast to an int if this is what you want.
- you shouldn't be using bytes to store numbers - that's unnecessary
I didn't agree with those conclusions, and I'm no longer using boost::format.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk