1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00
This commit is contained in:
terik23 2019-04-02 00:05:34 +05:00
parent d9ba68f01c
commit 0530e2c5bd
3 changed files with 35 additions and 35 deletions

View file

@ -41,10 +41,10 @@ int main() {
}
// Static storage enum variable to string enum name.
constexpr auto cx = Color::BLUE;
auto cx_name = magic_enum::enum_to_string<cx>();
if (cx_name.has_value()) {
std::cout << cx_name.value() << std::endl; // BLUE
constexpr auto c3 = Color::BLUE;
constexpr auto c3_name = magic_enum::enum_to_string<c3>();
if (c3_name.has_value()) {
std::cout << c3_name.value() << std::endl; // BLUE
}
return 0;