mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-07 01:06:42 +08:00
add Base to allow is_base_of to mimic is_enum
This commit is contained in:
parent
2fad3f60ee
commit
d22921e148
4
enum.h
4
enum.h
@ -485,6 +485,8 @@ struct _initialize_at_program_start {
|
|||||||
_initialize_at_program_start() { Enum::initialize(); }
|
_initialize_at_program_start() { Enum::initialize(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Base {};
|
||||||
|
|
||||||
} // namespace better_enums
|
} // namespace better_enums
|
||||||
|
|
||||||
|
|
||||||
@ -588,7 +590,7 @@ BETTER_ENUMS_ID(GenerateSwitchType(Underlying, __VA_ARGS__)) \
|
|||||||
\
|
\
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
class Enum { \
|
class Enum : better_enums::Base { \
|
||||||
private: \
|
private: \
|
||||||
typedef ::better_enums::optional<Enum> _optional; \
|
typedef ::better_enums::optional<Enum> _optional; \
|
||||||
typedef ::better_enums::optional<std::size_t> _optional_index; \
|
typedef ::better_enums::optional<std::size_t> _optional_index; \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user