Use std::bitset instead of plain ints for bitfield flags
In many, many places in the code, we currently use uint32_t as places to hold collections of flags. C++ has a class, std::bitset<N>, that behaves like a uint32_t in the ways in which is matters, but has some nice features.
- It can be any length. set at compile time via template arg.
- It can do standard biwise operators <<, &=
- It can also do array-like access, so checking the status of a flag can be done with fields[MY_FLAG]
- It has several readable methods for manipulating things, such as .flip(), .set(), clear(), any(), none(), reset()
If these are used, then it is clear that a particular variable is intended to be used as a collection of flags.
Class overview can be viewed at: http://
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Low
- Drafter:
- Monty Taylor
- Direction:
- Approved
- Assignee:
- Monty Taylor
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
-
Started
- Milestone target:
- None
- Started by
- Yoshinori Sano
- Completed by
- Jay Pipes
Whiteboard
Work Items
Dependency tree
![](deptree.png)
* Blueprints in grey have been implemented.