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

update example

This commit is contained in:
neargye 2019-09-29 16:22:58 +05:00
parent 2541180874
commit 289b96e561

View file

@ -33,7 +33,7 @@ int main() {
std::cout << c1_name << std::endl; // RED
// String enum name sequence.
constexpr auto color_names = magic_enum::enum_names<Color>();
constexpr auto& color_names = magic_enum::enum_names<Color>();
std::cout << "Color names:";
for (auto n : color_names) {
std::cout << " " << n;
@ -70,7 +70,7 @@ int main() {
std::cout << "Color[0] = " << magic_enum::enum_value<Color>(0) << std::endl; // Color[0] = RED
// Enum value sequence.
constexpr auto colors = magic_enum::enum_values<Color>();
constexpr auto& colors = magic_enum::enum_values<Color>();
std::cout << "Colors sequence:";
for (Color c : colors) {
std::cout << " " << c; // ostream operator for enum.