Getting enum from value

Kreikey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Aug 5 11:26:10 PDT 2017


On Saturday, 5 August 2017 at 15:33:57 UTC, Matthew Remmel wrote:
> I feel like I'm missing something, but there has to be an 
> easier way to convert a value into an enum than switching over 
> every possible value: i.e
>
> [...]

Capitals c = cast(Capitals)"Chicago";
writeln(c);    // Illinois


More information about the Digitalmars-d-learn mailing list