mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
v0.1.2
This commit is contained in:
parent
48e70234b5
commit
0ac07739f6
3 changed files with 106 additions and 80 deletions
|
|
@ -47,5 +47,19 @@ int main() {
|
|||
std::cout << c3_name.value() << std::endl; // BLUE
|
||||
}
|
||||
|
||||
constexpr auto colors = magic_enum::enum_sequence<Color>();
|
||||
std::cout << "Color sequence:";
|
||||
for (auto e : colors) {
|
||||
std::cout << " " << magic_enum::enum_to_string(e).value();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
constexpr auto colors_name = magic_enum::enum_to_string_sequence<Color>();
|
||||
std::cout << "Color sequence:";
|
||||
for (auto e : colors_name) {
|
||||
std::cout << " " << e;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue