|
Boost : |
From: Karl Nelson (kenelson_at_[hidden])
Date: 2002-01-22 12:21:29
> On Sun, 2002-01-20 at 23:13, Beman Dawes wrote:
> > I have the sense that Ed's operator[] suggestion would solve some technical
>
> > problems, but it just plain looks too ugly to me.
>
> oh, technically it's much the same as operator%..
>
> The difference is rather how to pass manipulators.
>
> nobody likes the 'glue()' function. I can rename it 'manip()', but it
> still isn't as nice as having a specific operator, like () for manips
> and [] for arguments.
I sent the solution to that problem. You define the manipulators as
shown in ...
http://www.ece.ucdavis.edu/~kenelson/iomanip.hh
(Similar can be coded for hex and non-argument iomanips)
Then you define your operator % to handle iomanip<T> seperately
from other tokens. Thus there would be no need for "glue" or "manip".
Simply
format(str) % 1 % boost::io::width(10) % 2;
--Karl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk