| 56 | } |
| 57 | |
| 58 | int main() { |
| 59 | std::cout << magic_enum::enum_name(Color::RED) << std::endl; // 'the red color' |
| 60 | std::cout << magic_enum::enum_name(Color::BLUE) << std::endl; // 'The BLUE' |
| 61 | std::cout << magic_enum::enum_name(Color::GREEN) << std::endl; // '' |
| 62 | |
| 63 | std::cout << std::boolalpha; |
| 64 | std::cout << (magic_enum::enum_cast<Color>("the red color").value() == Color::RED) << std::endl; // true |
| 65 | |
| 66 | std::cout << magic_enum::enum_name(Numbers::One) << std::endl; // 'the one' |
| 67 | std::cout << magic_enum::enum_name(Numbers::Two) << std::endl; // 'Two' |
| 68 | std::cout << magic_enum::enum_name(Numbers::Three) << std::endl; // 'Three' |
| 69 | |
| 70 | return 0; |
| 71 | } |