Bug 3999 and 4261

Nick Sabalausky a at a.a
Tue Aug 31 21:41:24 PDT 2010


"Andrej Mitrovic" <andrej.mitrovich at gmail.com> wrote in message 
news:mailman.28.1283307608.858.digitalmars-d at puremagic.com...
>
>That is all that I thought enums are useful for. But apparently an
>enum is a type and you can instantiate it.... and I don't even know
>what an enum is anymore. I'll just stay out of this discussion for
>now, lol. :)

This is the way I've always seen an enum:

An enum is a custom type with a pre-defined set of possible values, each 
individually-named. That's the primary purpose. Typically, an enum will have 
a "base" type which determines the physical in-memory representation of the 
values and allows for a convenient (but not accidentally-invoked) one-to-one 
mapping between the enum values and certain values from one other 
user-chosen type (ie, the base type). 




More information about the Digitalmars-d mailing list