Enum inheritance

Matthias Walter walter at mail.math.uni-magdeburg.de
Wed Aug 15 11:30:26 PDT 2007


Robert Fraser Wrote:

> Matthias Walter Wrote:
> 
> > For my current project, I would be happy to have some kind of enum inheritance, is it on the plan for future changes to D?
> 
> I made a number of enum extensions that renders each enum as a mixinable template that creates a struct. They allow pretty much everything people have been asking for in enums short of Java-style "enum classes." They have string printing, enum extension, iteration through enum values, ... Yeah, that's about it. And they're still only represented by one int, so no performance penalties.
> 
> I can post them if you want... Maybe I should put them in Scrapple.

I'm not in a hurry, so putting them in scrapple would be a good idea.

thanks
Matthias



More information about the Digitalmars-d mailing list