Why enum of structs are not initialised?

Jonathan M Davis jmdavisProg at gmx.com
Thu Aug 11 13:48:43 PDT 2011


On Thursday, August 11, 2011 13:18 bearophile wrote:
> mimocrocodil:
> > causes syntax error if I am uncommit second string in enum
> 
> I think D enums are mostly meant for enumerations, of things like ints,
> ushorts, chars, etc. (But enhancement requests are possible).

That's incorrect. TDPL specifically talks about using structs as the type of 
an enum. However, there are bugs with it which make it so that it doesn't 
really work at the moment. Among them are:

http://d.puremagic.com/issues/show_bug.cgi?id=4423
http://d.puremagic.com/issues/show_bug.cgi?id=5460

If you see any bugs with regards to structs not working as enum values, please 
report them if you can't find them in bugzilla.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list