"MIURA Masahiro" <[email protected]> wrote in message news:[email protected]... > In D2: > > enum Shape: string > { > Square = "Square", > Circle = "Circle", > } > > void main() > { > assert(cast(string) Shape.Square == "Square"); > }
So there's no built-in way to do this with compile-time reflection? I suppose I could work around it by creating a mixin that automatically generates both the enum and an enum->string routine.
