enum inheritance

JS js.mdnq at gmail.com
Sun Jul 14 21:27:41 PDT 2013


BTW, the usefulness is to group sub-enums into the same range. 
This would make it easy/efficient to branch over a range in the 
enum:

if (v in colors.Red) { v is a color in red }

instead of

if (v is color.Red || v is color.RedOrange || ...)


More information about the Digitalmars-d-learn mailing list