mirror of
https://github.com/Neargye/magic_enum
synced 2026-06-08 12:00:02 +00:00
move is_flags to customize::enum_range
force set the enum-flag true or false
This commit is contained in:
@@ -26,9 +26,11 @@
|
||||
#include <magic_enum.hpp>
|
||||
|
||||
enum class AnimalFlags : std::uint64_t { HasClaws = 1 << 10, CanFly = 1 << 20, EatsFish = 1 << 30, Endangered = std::uint64_t{1} << 40 };
|
||||
// Add specialization `is_flags_enum` to force define that enum are flags.
|
||||
// template <>
|
||||
// struct magic_enum::customize::is_flags_enum<AnimalFlags> : std::true_type {};
|
||||
// Add specialization `is_flags` to force define that enum are flags.
|
||||
//template <>
|
||||
//struct magic_enum::customize::enum_range<AnimalFlags> {
|
||||
// static constexpr bool is_flags = true;
|
||||
//};
|
||||
|
||||
int main() {
|
||||
// Enum-flags variable to string name.
|
||||
|
||||
Reference in New Issue
Block a user