Is it possible to derive from an enum, if so how?
For instance:
enum eStandardTypes
{
Type1 = 0,
Type2,
Unknown,
Count,
};
enum eExtendedTypes : eStandardTypes
{
Type3 = eStandardTypes::Count,
Unknown,
Count,
};
Is it possible to derive from an enum, if so how?
For instance:
enum eStandardTypes
{
Type1 = 0,
Type2,
Unknown,
Count,
};
enum eExtendedTypes : eStandardTypes
{
Type3 = eStandardTypes::Count,
Unknown,
Count,
};
No this is not possible, even with enum
classes.
Support for inheritance of enum
classes was discussed for C++17, but was not incorporated into that standard.