parse

Takes a string representing an enum type and returns that type.

Parameters

Target

the enum type to convert to

s Source

the lvalue of the range to parse

Return Value

Type: Target

An enum of type Target

Throws

A ConvException if type Target does not have a member represented by s.

Examples

enum EnumType : bool { a = true, b = false, c = a }

auto str = "a";
assert(parse!EnumType(str) == EnumType.a);

Meta

Suggestion Box / Bug Report