enum inheritance

JS js.mdnq at gmail.com
Mon Jul 15 03:17:07 PDT 2013


On Monday, 15 July 2013 at 08:20:20 UTC, Namespace wrote:
> Maybe this way?
>
> ----
> final abstract class Colors
> {
> 	enum Red { RedOrange }
> 	enum Green { GreenBlue}
> 	enum Blue { BlueYellow }
> }
>
> void main() {
> 	Colors.Red foo = Colors.Red.RedOrange;
> 	assert(foo >= Colors.Red.min && foo <= Colors.Red.max);
> }
> ----

but RedOrange and GreenBlue have the same value!




More information about the Digitalmars-d-learn mailing list