mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
update example
This commit is contained in:
parent
e57ea6f550
commit
99e4d7c7aa
1 changed files with 3 additions and 2 deletions
|
|
@ -80,8 +80,9 @@ int main() {
|
|||
|
||||
enum class Flags { A = 1 << 0, B = 1 << 1, C = 1 << 2, D = 1 << 3 };
|
||||
using namespace magic_enum::bitwise_operators; // out-of-the-box bitwise operators for enums.
|
||||
Flags flags = Flags::A | Flags::B & ~Flags::C;
|
||||
std::cout << magic_enum::enum_integer(flags) << std::endl;
|
||||
// Support operators: ~, |, &, ^, |=, &=, ^=.
|
||||
Flags flags = Flags::A & ~Flags::C;
|
||||
std::cout << flags << std::endl;
|
||||
|
||||
enum color { red, green, blue };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue