Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-02-12 14:48:53


On 2/12/02 11:07 AM, "Karl Nelson" <kenelson_at_[hidden]> wrote:

> Should we just define a subset of printf which is common between
> iostream and support that or graft a whole lot which is isn't?
> Ie. truncation of strings is in printf but not iostream,
> padding with 0 and show base are in iostream but do not interact
> like printf. (00000x1 rather than 0x00001)
> Is it acceptable to just make close to printf with well
> documented differences or is strong compatiblity the best option?

If it was up to me, I would opt for strong compatibility. I don't think of
this as an extension to ostream, but rather a suitable implementation of
printf-style formatting to use in C++. Working well with ostream and string
seems like a requirement. Using ostream as implementation machinery does
not.

Using ostream to efficiently implement this with a minimum amount of code
was your idea, and I think it's a pretty good one. But it might get in the
way of doing a good job at printf compatibility.

> It is my general feeling that grafting these features on is adding
> things which istream itself should have. But does boost
> really want to have its own non-standard iostream interface?

I wouldn't go that direction, myself.

    -- Darin


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