Boost logo

Boost :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2001-06-29 15:09:43


> I am quite taken with Sam's use of '%'.

ah, great !

> 2. We really aren't doing streaming in this case. It might be better to use
> a distinct operator to separate formatting from streaming.

That's exactly my opinion !

> 3. Less typing - one of the original motivations of the format challenge was
> that doing output formatting in C++ costs many more messy characters than it
> used to in C.

I must say I deeply agree, once again ;)

> 4. As Sam pointed out in private email, % has some nice precedence
> properties.

yes, it helps having a format class with a very simple design.

> The use of * is a little strange to me, but for non-sticky users it would
> probably not show up, right?

I'm not sure the usage of operator* is clear for everybody :

. the manipulators passed through * are not sticky for the remaining of
the format. they are only used when formatting the *following* argument.
. For this usage, I need a separate operator, so that I dont need to guess
what objects are manipulators and what objects are arguments.
But maybe I missed a clever trick that could allow to specialize the
regular operator for the right objects..

anyway, I think the possibility to pass manipulators to modify the
formatting of the next argument is a feature that must be supported.
and for the moment, having a second operator (of same percedence..) is the
best solution I found.

-- 
Sam

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