1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00

example_switch.cpp: properly return 0 (#336)

This commit is contained in:
Stephan Lachnit 2024-02-10 13:13:25 +01:00 committed by GitHub
parent b4ada55c8c
commit 66e5a46094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,4 +102,6 @@ int main() {
std::cout << magic_enum::enum_switch(switcher3, Color::GREEN, std::make_optional("cica")).value() << std::endl; // prints default: "cica"
std::cout << magic_enum::enum_switch(switcher3, Color::RED, std::make_optional("cica")).value() << std::endl; // prints: "red result"
std::cout << magic_enum::enum_switch(switcher3, Color::BLUE, std::make_optional("cica")).has_value() << std::endl; // prints: false
return 0;
}