A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iterating over those.
A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iterating over those.
Rationale
Enums are great, as long as you use them to represent individual flags or options. If you want to represent a set of options using an enumeration, one would typically let the values of the enumeration take on powers of two and then "or" them together
enum class option
{
A = (1 << 0),
B = (1 << 1),
C = (1 << 2)
};
int operator|(option lhs, option rhs)
{
return static_cast<int>(lhs) | static_cast<int>(rhs);
}
... More
license | MIT |
---|---|
project | enum_set |
url | github.com/cdeln/cpp_enum_set |
src-url | github.com/cdeln/cpp_enum_set |
carl@dehlin.com | |
topics | enum setstype setstype safetyfixed size containers |
1 Version
version | 0.1.0-a.1 |
---|---|
repository | https://pkg.cppget.org/1/alpha |
depends | 2; doctest, magic_enum |
requires | 1; c++ >= 17 |