|
Boost : |
From: Samuel Krempp (krempp_at_[hidden])
Date: 2001-06-30 09:36:03
On another plane than the isssues on operators vs function, how to treat
the manipulators etc..,
I'm open to suggestions on what could be a nice feature to add to a
formatting class / function.
So long, centered-alignment was brought in with previous format class, and
is already implemented in my format2.
I have a project to provide a much more innovative feature :-),
which is some kind of a customised-tabulations system :
It would have a syntax precising a number, but would *not* specify a
argument number, as it would not print in one of the arguments, but merely
is in itself a special printing directive.
let 's fix a first-try syntax,
$t40 to mean "tabulation-40"
( while $1 means "argument 1", in a shell-like syntax, and %1$s means the
same in a printf syntax, both supported, but that's not the point here..)
then I'm thinking of this :
format("$1, at $2, with x=$3: $t40$4\n") %arg1 %arg2 %arg3 %arg4
The result would be that the argument 4 would be printed at colon 40,
that is, the previous part of the string would be padded to reach 40
characters (unless it is already bigger)
I find that useful because most of the time we only want to align one (or
maybe 2..) arguments on a fixed position, when we print stuff indicating
progress of computations within a loop, or so..
Would such a feature please someone, beyond me ?
-- Sam
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk