Boost logo

Boost :

From: Rüdiger Loos (loos_at_[hidden])
Date: 2000-04-26 09:00:50

> on 4/25/00 12:52 PM, Gary Powell at Gary.Powell_at_[hidden] wrote:
> > Also I was wondering if format should save the state of the iostream and
> > reset it after formatting each value. More of the way that printf works. (In
> > that centering one value doesn't leave the stream in a center all values
> > state.)
> I didn't have a chance to notice that, but it certainly was one goal of my
> original proposal to restore the stream state.
...and it was one goal of my implementation. May be I'm wrong, but I don't see how
the private ostringstream 'oss' of format can be influenced from the stream in which
format is embedded. Vice versa, format passes a string to operator<< that does not
affect the external stream state differently than any other string.
Inside of format for EACH positional parameter width is initialized to 0 and
alignment to right (at the beginning of 'process'), what can be changed by %w.. or %l
%c respectively. This (non-sticky) behavior cannot be overwritten by any other format
parameters or parameters of the external stream - the state of which can't be
influenecd by 'oss'.
If I miss the point, please give me an example that does not work as intended.

Boost list run by bdawes at, gregod at, cpdaniel at, john at