|
Boost : |
From: Karl Nelson (kenelson_at_[hidden])
Date: 2001-12-19 14:07:49
> On Wed, 2001-12-19 at 19:52, Peter Dimov wrote:
>
> > Looks like this should be an option, then. Some people might have existing
> > pre-translated printf-style strings lying around. ;-)
>
> That was precisely my reasonning, and that's what I did.
> format( s ) => s can contain "%1" ('short-style directives')
> or "%p10.3G" ('printf-like notation', prefixed with a 'p')
> pformat( s ) => parses s just like printf would.
This still does not address the ambiguity point. The elegance
of printf formats is that it has both a starting char and ending one.
Also if you are going to do a simple format class why %1 instead of $1
which is more familiar to shell coders. Then you could resolve
the ambiguity with ${10} (Okay, maybe too much perl programming in recent
times.
--Karl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk