"Denis Koroskin" <[email protected]> wrote: > Great, now the following is possible with your code: > > string toString(Enum)(Enum e) if (is(Enum == enum)) > { > return enumToString(e); > } > > assert("RED" == toString(c)); > > // and, once implemented: > assert("RED" == c.toString()); > > Although returning "Color.RED" might be better, but it's really not a problem. > Is there any way your code could be contributed to Phobos?
Sure. I think it can be merged into std.conv.to.
