How to obtain a list of all the elements of an enum?

Mike none at none.com
Sat Apr 5 19:28:19 PDT 2014


On Sunday, 6 April 2014 at 02:18:57 UTC, dnspies wrote:
> If I have an enum:
>
> enum x {A : 1, B : 2, C : 100};
>
> How can I get a list of all of its elements?
>
> x.get_list() (returns [A, B, C])

I believe this is what you're looking for:

http://stackoverflow.com/questions/22577000/how-to-iterate-over-enums


More information about the Digitalmars-d-learn mailing list