expandEnum

Expands enum into single members, keeps case

enum expandEnum (
EnumType
string fqnEnumType = EnumType.stringof
)

Examples

enum Elements {
    One,
    Two,
    Three,
    Four
}
mixin(expandEnum!Elements);
/// Is going to be turned into
enum {
    One = Elements.One,
    Two = Elements.Two,
    Three = Elements.Three,
    Four = Elements.Four
}
/// And can be used as single value
void main() {
    import std.stdio;
    /// Both are valid
    writeln(One);
    writeln(Elements.One);
}

Meta