Re: Min, max of enum

2017-01-26 Thread Biotronic via Digitalmars-d-learn
On Thursday, 26 January 2017 at 05:58:26 UTC, Profile Anaysis wrote: Since we do not have attributes for enums, I use _ in front of the names for meta values. I need to get the non-meta values for the enum so I can iterate over it and use it properly. enum myEnum { _Meta1 = 0, A,B,C,

Re: Min, max of enum

2017-01-25 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 26 January 2017 at 05:58:26 UTC, Profile Anaysis wrote: Since we do not have attributes for enums, I use _ in front of the names for meta values. [...] This can be done with Ctfe mixins and __traits, look at __traits(allMembers)

Min, max of enum

2017-01-25 Thread Profile Anaysis via Digitalmars-d-learn
Since we do not have attributes for enums, I use _ in front of the names for meta values. I need to get the non-meta values for the enum so I can iterate over it and use it properly. enum myEnum { _Meta1 = 0, A,B,C, _Meta3 = 43, D = 3, } The num, for all practical purposes do