Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-02-12 07:05:30


From: "Karl Nelson" <kenelson_at_[hidden]>
> > format("{2:10} is {1:6.3f}", "test", 0.5);
>
> That is perfectly compatiable with using a printf frontend if
> you just add a %...
>
> format("%10s is %6.3f","test", 0.5)
>
> means same as
> format("%{1:10s} is %{2:6.3f}", "test", 0.5)
> is
> to_string("test","10s") + " is " + to_string(0.5,"6.3f")

Yes, my thoughts exactly. The format string parser is a separate,
independent component as well.

I'll try to come up with a prototype (when I find time.)

The advantage of the %{} notation is that you can mix and match %s, %2$s,
%{1:s}, but it's not .net compatible. ;-)


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