I have a variable declared as:
enum class FooEnum: uint64_t {}
and I would like to cast to its base-type, but I don't want to hardcode the base-type. For instance, something like this:
FooEnum myEnum;
uint64_t * intPointer = (underlying_typeof(myEnum))&myEnum;
Is this possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…