enum E { unknown, x, y, z, z_ = z, }
assert(E.x.toStringFromEnumWithConsecutiveAliases == "x");
assert(E.y.toStringFromEnumWithConsecutiveAliases == "y");
assert(E.z.toStringFromEnumWithConsecutiveAliases == "z");
assert(E.z_.toStringFromEnumWithConsecutiveAliases == "z");
Fast and more generic implementation of std.conv.to for enumerations. TODO: Handle non-adjacent enumerator aliases.