Boost logo

Boost Users :

From: Oliver Schoenborn (oliver.schoenborn_at_[hidden])
Date: 2005-10-22 17:52:03


> - Why did you choose strf() and scoutf()?
> Usually there aren't any abbreviations in std stuff, and
> strstream is deprecated now in favour of stringstring, so
> wouldn't stringf() make more sense? Also, scoutf seems odd,
> since it has nothing whatsoever to do with cout. Perhaps
> streamf() would be better? It parallels
> stringf() slightly better, imho.

I've been thinking lately that scoutf should be renamed. As to the rest, I
agree. I haven't even chosen a namespace. Given how often those functions
are used (in my code, especially in combination with boost log and boost
test), I want the names to be short but expressive. If there is further
interest in boostifying this I am open to suggestions such as the above.

> - How well does it handle references?
> Although that can presumably avoided with reference_wrapper

Specific example? I'd like to try it out.

> - How much performance does not doing it
> boost.format-%-overload-style save?
> There is a certain elegance to doing it that way...

Basically (as of boost 1.32), coutf is less than 10% slower than explicitely
calling operator<< and manipulators, whereas boost.format is 70% slower. As
with any benchmarking, it depends on how you use the stuff, I'm sure there
are cases where the numbers are reversed, but the benchmarking I did is for
what I perceive as "typical" use cases. See the web page.

Oliver


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net