Enum "Inheritance"?

%u wfunction at hotmail.com
Wed Feb 23 16:26:13 PST 2011


>> enum AccessMask { GenericRead = 0x80000000 }
>> enum FileAccess : AccessMask { ReadData = 1 } //Errors

> Nice. Has Walter thought about the possibility of such D code? Similar problems with typedef
(that doesn't play well with OOP) have pushed Andrei to remove typedef from D. So be careful,
or we'll lose enum too :o)

Lol, okay. Do you have any other suggestions for a better solution on how to avoid duplicating
generic access masks like MAXIMUM_ALLOWED inside each access mask type?


More information about the Digitalmars-d mailing list