mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
v0.2.0
This commit is contained in:
parent
122aa8028d
commit
5a3d4b53e6
5 changed files with 105 additions and 70 deletions
|
|
@ -47,8 +47,8 @@ int main() {
|
|||
std::cout << c3_name.value() << std::endl; // BLUE
|
||||
}
|
||||
|
||||
constexpr auto colors = magic_enum::enum_sequence<Color>();
|
||||
std::cout << "Color sequence:";
|
||||
constexpr auto colors = magic_enum::enum_to_sequence<Color>();
|
||||
std::cout << "Colors:";
|
||||
for (auto e : colors) {
|
||||
std::cout << " " << magic_enum::enum_to_string(e).value();
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ int main() {
|
|||
// Color sequence: RED BLUE GREEN
|
||||
|
||||
constexpr auto color_names = magic_enum::enum_to_string_sequence<Color>();
|
||||
std::cout << "Color sequence:";
|
||||
std::cout << "Color names:";
|
||||
for (auto e : color_names) {
|
||||
std::cout << " " << e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue