enum type to introspect
some string that corresponds to some key name of the given enum
resulting enum index if this method returns true.
boolean whether the key was found in the enum keys and if so, index is set.
enum Short { hello, world } enum Long { This, Is, An, Enum, With, Lots, Of, Very, Long, EntriesThatArePartiallyAlsoVeryLongInStringLengthAsWeNeedToTestALotOfDifferentCasesThatCouldHappenInRealWorldCode_tm } uint i; assert(getEnumIndexFromKey!Short("hello", i)); assert(i == 0); assert(getEnumIndexFromKey!Short("world", i)); assert(i == 1); assert(!getEnumIndexFromKey!Short("foo", i)); assert(getEnumIndexFromKey!Short("HeLlO", i)); assert(i == 0); assert(getEnumIndexFromKey!Short("WoRLd", i)); assert(i == 1); assert(!getEnumIndexFromKey!(Short, false)("HeLlO", i)); assert(!getEnumIndexFromKey!(Short, false)("WoRLd", i)); assert(getEnumIndexFromKey!Long("Is", i)); assert(i == 1); assert(getEnumIndexFromKey!Long("Long", i)); assert(i == 8); assert(getEnumIndexFromKey!Long("EntriesThatArePartiallyAlsoVeryLongInStringLengthAsWeNeedToTestALotOfDifferentCasesThatCouldHappenInRealWorldCode_tm", i)); assert(i == 9); assert(!getEnumIndexFromKey!Long("EntriesThatArePartiallyAlsoVeryLongInStringLengthAsWeNeedToTestALotOfDifferentCasesThatCouldHappenInRealWorldCodeatm", i)); assert(!getEnumIndexFromKey!(Long, false)("EntriesThatArePartiallyAlsoVeryLongInStringLengthAsWeNeedToTestALotOfDifferentCasesThatCouldHappenInRealWorldCode_tM", i)); assert(!getEnumIndexFromKey!(Long, false)("entriesThatArePartiallyAlsoVeryLongInStringLengthAsWeNeedToTestALotOfDifferentCasesThatCouldHappenInRealWorldCode_tm", i));