MCPcopy Create free account
hub / github.com/Neargye/magic_enum / main

Function main

example/example_containers_array.cpp:52–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50constexpr std::uint8_t color_max = std::numeric_limits<std::uint8_t>::max();
51
52int main() {
53
54 constexpr magic_enum::containers::array<Color, RGB> color_rgb_initializer {{{{color_max, 0, 0}, {0, color_max, 0}, {0, 0, color_max}}}};
55
56 std::cout << magic_enum::containers::get<0>(color_rgb_initializer) << std::endl; // R=255 G=0 B=0
57 std::cout << magic_enum::containers::get<1>(color_rgb_initializer) << std::endl; // R=0 G=255 B=0
58 std::cout << magic_enum::containers::get<2>(color_rgb_initializer) << std::endl; // R=0 G=0 B=255
59
60 std::cout << magic_enum::containers::get<Color::RED>(color_rgb_initializer) << std::endl; // R=255 G=0 B=0
61 std::cout << magic_enum::containers::get<Color::GREEN>(color_rgb_initializer) << std::endl; // R=0 G=255 B=0
62 std::cout << magic_enum::containers::get<Color::BLUE>(color_rgb_initializer) << std::endl; // R=0 G=0 B=255
63
64 return 0;
65}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected