struct EnumToFlags(alias E) { template opDispatch(string Name) { enum opDispatch = 1 << __traits(getMember, E, Name); }; }; enum X { a,b,c } auto q = EnumtoFlags!X; auto m = q.a; with(q) { auto m = a; } a undefined.Any way to get it to work? Maybe a full blowing string mixin is needed to generate the flag enum?
- with not working wtih BitFlags Jot via Digitalmars-d-learn
- Re: With not working with BitFlags Dukc via Digitalmars-d-learn
- Re: With not working with BitFlags Dukc via Digitalmars-d-learn
- Re: With not working with BitFlags Jot via Digitalmars-d-learn