enum values without initializer

BCS none at anon.com
Sat Apr 3 11:55:30 PDT 2010


Hello bearophile,

> Do you know why this is an error?
> 
> struct Foo {}
> enum Foo f;

The only way to make that legal would be to 1) add a special corner case 
rule or 2) allow "enum type name;" for all types.

#1 is a bad idea as are almost all special case rules
#2 is just flat wrong 99.9% of the time.

-- 
... <IXOYE><





More information about the Digitalmars-d-learn mailing list