mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
move is_flags to customize::enum_range
force set the enum-flag true or false
This commit is contained in:
parent
a8c9e57fbe
commit
9ed19fb9e9
4 changed files with 22 additions and 17 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue