Re: With not working with BitFlags

2017-01-20 Thread Jot via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:12:04 UTC, Dukc wrote: This is fairly complex thing, but I managed to get it working: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; private static auto implementation() { string result; forea

Re: With not working with BitFlags

2017-01-20 Thread Dukc via Digitalmars-d-learn
On Friday, 20 January 2017 at 09:12:04 UTC, Dukc wrote: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; //... } I think that typecons import was needless, you could try removing it...

Re: With not working with BitFlags

2017-01-20 Thread Dukc via Digitalmars-d-learn
This is fairly complex thing, but I managed to get it working: template EnumToFlags(E) if(is(E == enum)) { import std.traits, std.typecons, std.string; private static auto implementation() { string result; foreach(i, enumMem; EnumMembers!E) { resul