Enum member whose string name we want.
The string name of the passed enum member, or (for instance) cast(E)1234 if an invalid value of 1234 was passed, cast to type E.
enum SomeEnum { one, two, three }; string foo = Enum!SomeEnum.toString(SomeEnum.one); assert(foo == "one");
The inverse of fromString, this function takes an enum member value and returns its string identifier.
It lowers to a big switch of the enum members. It is faster than std.conv.to and generates less template bloat.
Taken from: https://forum.dlang.org/post/bfnwstkafhfgihavtzsz@forum.dlang.org written by Stephan Koch (https://github.com/UplinkCoder). Used with permission.