How to get value of enum without casting

Justin Whear via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jul 9 09:27:10 PDT 2015


On Thu, 09 Jul 2015 16:20:56 +0000, tcak wrote:

> Is there any way to get the type of enum without interacting with its
> items?
std.traits.OriginalType

> Is there any way to get string representation of an item of enum without
> casting?
I think casting to the OriginalType and then using to!string is the 
correct way to do this.


More information about the Digitalmars-d-learn mailing list