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
Sure, that's nifty.
- Move io to a separate header so iostream isn't necessary just to use
- Bitfield io should'n force hex, 0-filled output for missing values. Let
> 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
> text should be used for output.
> - The normal separator in a stream is characters where isspace returns
> 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
- 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
> 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
> (entire output can be handled by using a temporary buffer but not the
> way around).
> Code change is trivial. Just save width on entry and apply it before
> each value when width>0.
> cout << boolalpha << setw(10) << setfill('-') << right << mousekey;
> -----Shift ---Control
> cout << noboolalpha << dec << mousekey;
OK, I'll monkey around with these suggestions and see how they turn out.
Thanks for the comments!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk