Performs checked conversion from an integral type From to an $(D_KEYWORD enum).
Source type.
Target type.
Source value.
$(D_KEYWORD enum) value.
$(D_PSYMBOL ConvException) if from is not a member of $(D_PSYMBOL To).
enum Test : int { one, two, } static assert(is(typeof(1.to!Test) == Test)); assert(0.to!Test == Test.one); assert(1.to!Test == Test.two);
See Implementation
Performs checked conversion from an integral type From to an $(D_KEYWORD enum).