magic_enum
magic_enum copied to clipboard
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
Clang has recently [addressed](https://reviews.llvm.org/D130058) an https://github.com/llvm/llvm-project/issues/50055 where it failed to diagnose the UB of casting an out-of-range integer to an enum in a constant expression. Since undefined behavior is not...
``` E0095 Array is too large magic_enum\magic_enum.hpp 198 in class "magic_enum::detail: :static_string [where N=18446744073709551600Ui64]" on line:341 Detected during instantiation ``` When I compile the project with VS2022, the compiler reports...
would it be possible to support enum_switch the way that we're used to use overload pattern with std::visit? e.g ```c++ return magic_enum::enum_switch( overloaded{ []( my_enum::val1 arg ) -> int {...
https://gist.github.com/Korsar13/5c171d0cd0b47d62276cac07b6b6a184 compiled by clang, prints ``` convert from char to char convert from char to int convert from char to float convert from int to char convert from int to...
https://github.com/Neargye/magic_enum/issues/193
manual set(MAGIC_ENUM_OPT_BUILD_EXAMPLES ON) target_link_libraries(${target} PRIVATE ${CMAKE_PROJECT_NAME}) target_link_libraries(${target} PRIVATE ${PROJECT_NAME}) ?
Would it make sense to have a shorthand for enum_name which can cast? Such that this: ```c++ enum class Color { RED = 2, BLUE = 4, GREEN = 8...
Is it possible to support wide char ? #define MAGIC_ENUM_USING_ALIAS_STRING_VIEW using string_view = std::wstring_view; #define MAGIC_ENUM_USING_ALIAS_STRING using string = std::wstring; #include "magic_enum.hpp" wstring_view name = magic_enum::enum_name(Color::Red);