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.
Enum member whose string name we want.
The string name of the passed enum member.
enum SomeEnum { one, two, three }; string foo = Enum!SomeEnum.toString(one); assert(foo == "one");
See Implementation
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.