* Frank Bergemann:
does the c++0x 'enum class' support state/value extension by
inheritance?
I.e. can i have a base enum class, which can be extended (also
overidden?) by inheritance?
If it does (I haven't checked but I very much doubt it), and if that kind of
inheritance works approximately like class inheritance, then that would be a
defect in the draft standard.
For with an enum, an extension is not a sub-type, it is a super-type, which
means that inheritance "goes the wrong way".
For example, if F is an extension of enum type E, and you have a routine that
expects an E and relies (e.g. in a 'switch') on knowing all possible values of
E, then if you could pass an F, that is if F worked type-wise as a sub-type,
then you would break the routine's assumption of knowing all possible values.
This is not to say enum inheritance can't be made to work.
But the rules for type compatibility are topsy-turvy and counter-intuitive,
almost like member pointers versus ordinary pointers.
Cheers & hth.,
- Alf