Skip to main content

Generated documentation outline

Selected cpp guides

The fixed, symbol-backed guide plan used by this isolated hosted publication Flyte canary.

Inspect and validate flag enums

Build a source-grounded C++ guide to formatting flag enums and checking whether flag values are represented by the selected magic_enum APIs. Keep examples limited to the selected flag APIs and the definitions needed to demonstrate them. Include the source-owned magic_enum/magic_enum_flags.hpp header; use normal #include syntax only inside fenced C++ code and spell header paths in prose as inline code. When combining scoped flag values, make magic_enum::bitwise_operators visible before using operator|, and include every required standard header so each snippet is compile-ready.

  • Document type: how_to
  • Source symbols: magic_enum.enum_flags_name, magic_enum.enum_flags_contains

Iterate, dispatch, and store enum values

Build a source-grounded C++17 guide to iterating and dispatching over enum values and storing them in enum-aware containers with the selected magic_enum APIs. Keep examples limited to the selected iteration, switch, and container APIs, plus enum_name for display; do not add unrelated conversion helpers. For an enum_constant lambda parameter named val, invoke it and use enum_name(val()) or enum_name<val()>(); both enum_name(val) and enum_name<val>() are invalid because val is an object, not an enum value or non-type template argument. Use the source-owned magic_enum/magic_enum_utility.hpp, magic_enum/magic_enum_switch.hpp, and magic_enum/magic_enum_containers.hpp headers for their respective APIs; magic_enum.hpp does not exist. Use normal #include syntax only inside fenced C++ code and spell header paths in prose as inline code. Every enum_switch call must specify an explicit safe result type, such as std::string, so an invalid enum produces an empty value instead of converting a null pointer to std::string_view. A lambda passed directly to enum_switch must also declare the matching trailing return type, for example [](auto val) -> std::string, and every branch must return that type. Default-construct containers::array examples and assign entries by enum key instead of using aggregate brace initialization. Do not compare std::array values inside static_assert because equality is not constexpr in C++17; check individual elements instead. Include every required standard header.

  • Document type: guide
  • Source symbols: magic_enum.enum_for_each, magic_enum.enum_switch, magic_enum.containers.array, magic_enum.containers.set