|
Boost : |
From: bill_kempf (williamkempf_at_[hidden])
Date: 2002-01-31 10:31:59
--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> From: "bill_kempf" <williamkempf_at_h...>
> > When speaking of locality, to me the important thing is to keep
the
> > formatting code with the object being formatted. In other words,
I
> > think that:
> >
> > cout << format("[1]") << width(10) << foo;
> >
> > is much preferrable to:
> >
> > cout << format("[1:10]") << foo;
> >
> > I think it's easier to read and comprehend, and it certainly will
> > make the translation of the format string easier.
>
> Unless the width needs to be "translated," too.
I thought of that, but honestly see no problems here. The width is
passed to the manipulator in my example and could as easily be
fetched out of a locale specific database as you'd fetch out the
format string.
Bill Kempf
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk