1
0
Fork 0
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:
terik23 2019-07-25 00:11:13 +05:00
parent e57ea6f550
commit 99e4d7c7aa

View file

@ -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 };