Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2001-12-19 13:56:45


On Wed, 2001-12-19 at 19:04, rogeeff wrote:
> 1. What is an advantage of your format functionallity over regular
> ostream one?

you give the format string in one place, and all variables later, like
cout << format("x=%1, y=%2 \n") % x % y;
That's what many people miss when they use streams instead of printf I/O

> 2. What price for using of your format? in turms of memory and
> performance.

in perf, there's a 2-5 time factor when compared to the equivalent
stream code, written by hand.
I think the price in memory is a factor 2. (we store each piece of the
final string separately, and then concatenates them all, so at this
instant we need twice the memory needed for the final string)

> 3. How portable the code you supplied is

It compiles with g++-3.0, not with g++-2.95.
Jens Maurer reported success in compiling the code with KCC and comeau,
but not Intel 5.0.1 beta.

And I don't have access to a VC++ compiler.

regards,

-- 
Sam

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