enum X { a, b, _b = b // enumerator alias } alias EnumX = Enum!X; assert(EnumX(X.a).toString == "a"); assert(EnumX(X.b).toString == "b"); assert(EnumX(X._b).toString == "b"); // alias encodes to original
https://forum.dlang.org/thread/ppndhxvzayedgpbjculm@forum.dlang.org?page=1
TODO: Move logic to std.conv.to.
Enumeration wrapper that uses optimized conversion to string (via toString member).