2

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,
};
Bathsheba
  • 227,678
  • 33
  • 352
  • 470
Tim
  • 101
  • 9

1 Answers1

6

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.

Bathsheba
  • 227,678
  • 33
  • 352
  • 470