Enum "Inheritance"?

bearophile bearophileHUGS at lycos.com
Wed Feb 23 15:12:10 PST 2011


%u:

> 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)

Bye,
bearophile


More information about the Digitalmars-d mailing list