AliasedEnumMembers

Alias the members of an enum, allowing to use them without the parent name, and making the use of EnumSet more friendly.

mixin template AliasedEnumMembers (
E
string prefix = ""
) if (
is(E == enum)
) {}

Parameters

E

The named enum to alias.

prefix

The prefix of the aliases.

Examples

1 enum Option {Option1, Option2}
2 mixin AliasedEnumMembers!(Option, "o");
3 static assert(oOption1 is Option.Option1);
4 
5 alias Options = EnumSet!(Option, Set8);
6 Options opts = Options(oOption1);

Meta