Bitset class directly convertible to boolean. More...
#include <bitset.h>
Public Member Functions | |
Bitset ()=default | |
Default ctor. More... | |
template<typename T > | |
Bitset (T const &x) | |
Standard ctor: constructible from anything that can be a std::bitset constructor argument. More... | |
operator bool () const | |
True if any bit is set. More... | |
Bitset | operator& (Bitset const &other) const |
Logical AND of each bit in *this and other More... | |
Bitset | operator| (Bitset const &other) const |
Logical OR of each bit in *this and other More... | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int in_version) |
Boost serialisation support. More... | |
Static Public Attributes | |
static constexpr unsigned int | version = 1 |
Boost serialisation version. More... | |
Private Attributes | |
std::bitset< sz > | data |
std::bitset storing the data More... | |
Bitset class directly convertible to boolean.
Useful for flagged enumerations. Use as follows:
sz | the size of the bitset (number of bits), this many orthogonal flags are allowed |