26 Oct
2018
26 Oct
'18
8:33 a.m.
There are std::bitset (fixed size, allocates on the stack) and boost::dynamic_bitset (dynamic size, allocates from stack and heap)
https://www.boost.org/doc/libs/1_68_0/libs/dynamic_bitset/dynamic_bitset.htm...
The latter also has more sensible implementations of operator& and operator|. Before you invent a new thing, what is wrong with these classes?
Naming and type safety. Example: `File open(std::path, AccessMode)` Usage: `auto file = open("myPath/filename.foo", AccessMode::Read | AccessMode::Write)` - Named access to bits (Read/Write) instead of indices - Type safety: AccessMode instead of std::bitset, and you can't pass e.g. Includes::All to AccessMode just the same as strong enums protect against a similar issue