Boost logo

Boost :

From: Frank Laub (frank.laub_at_[hidden])
Date: 2005-12-22 04:41:13


>
> - a bitfield member returning number of bits set (count() ?) could be
> useful.

Sure, that's nifty.

- Move io to a separate header so iostream isn't necessary just to use
> BOOST_ENUM.

OK, reasonable.

- Bitfield io should'n force hex, 0-filled output for missing values. Let
> the
> caller decide (or at least restore the stream format flags after).
> - Maybe the io could use the boolalpha flag to decide if a numeric value
> or
> text should be used for output.
> - The normal separator in a stream is characters where isspace returns
> true,
> not "|".

Agreed, the stream operators were just me playing around mostly. I'm glad to
hear people with specific requirements for it. Making it
flexible/customizable for the end-user sounds like a high priority for these
features.

- I don't think it is necessary for bitfield operator>> to handle multiple
> entries. It can be added on top by the caller if necessary. It should
> allow
> numeric input though.

Hmm, I'm really trying to free the user from having to write extra code.
Would it really hurt anything if the user could specify the delimiters or
could enable/disable this functionality? It obviously isn't written yet, so
I could just be lazy and leave it as you suggest.

- Bitfield io should also handle format flags like width, right etc. My
> suggestion is to let the width apply to each item and not to the entire
> value
> (entire output can be handled by using a temporary buffer but not the
> other
> way around).
> Code change is trivial. Just save width on entry and apply it before
> streaming
> each value when width>0.
>
> e.g.
> cout << boolalpha << setw(10) << setfill('-') << right << mousekey;
> outputs:
> -----Shift ---Control
>
> cout << noboolalpha << dec << mousekey;
> outputs:
> 12

OK, I'll monkey around with these suggestions and see how they turn out.

Thanks for the comments!
-Frank


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