enum

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Sun Apr 13 19:27:24 PDT 2014


On Sunday, 13 April 2014 at 13:50:14 UTC, Jonathan M Davis wrote:
> Regardless, I'd never use an enum to partially enumerate values 
> for a type,
> because I think that that violates the very concept of what an 
> enumeration is.

Then you cannot write forward compatible code without creating 
lots of unused enum values, but I guess that is a reasonable 
tradeoff.

> And I expect that enums get used so frequently in other ways 
> primarily due to
> the fact that C's enums are so weakly typed.

No, it was recommended as a better way to create integer 
constants than #define. Older codebases use #define more.

Ola.





More information about the Digitalmars-d mailing list