Boost logo

Boost :

From: Martin (adrianm_at_[hidden])
Date: 2005-12-21 18:11:07

Some more suggestions:

- a bitfield member returning number of bits set (count() ?) could be useful.
- 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 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 "|".
- 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.
- 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.

  cout << boolalpha << setw(10) << setfill('-') << right << mousekey;
-----Shift ---Control

  cout << noboolalpha << dec << mousekey;

Boost list run by bdawes at, gregod at, cpdaniel at, john at