Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-07-02 11:29:17


Samuel Krempp wrote:
> > My main problem with '%' is that it's not an idiomatic C++,
> > at least not yet
>
> yes, but in a line like
> cout << format(" %1 %2 %3") %x %y %z << "bla bla";
> (or,
> logMessage(format("Error: %1 with x=%2") %msg %x);
>
> it should not be too hard to guess that % cant be the
> arithmetic modulus.

It isn't, indeed.
 
> Anyway, everybody should at least play a few hours with
> python in their life, beacause it really is nice.
> And thus, everybody should be used to python's usage of %.
> And thus format's usage of operator% should look perfectly
> natural to everybody, The case is closed.. ;-)

Ok, given the consistency between format string and "output" operator, I am
convinced :).

[snip]
> An alternative is to have 2 format constructors,
> format and pformat (or whatever, meaning 'printf format')
> % and $ uses being exchanged between one and another.
> So people needing printf compatible format are happy, using pformat,
> and people liking short notation are happy too.

I am not sure about the need for printf compatibility. Those who want to
have 'sprintf' functionality already have it ;).

Aleksey


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