oneOf

bool
oneOf
(
E
T
)
(
T val
)
if (
is(E == enum)
)

Examples

1 enum TestEnum
2 {
3     ONE = 1,
4     TWO = 2,
5     FOUR = 4
6 }
7 
8 assert( !oneOf!TestEnum(0) );
9 assert(  oneOf!TestEnum(1) );
10 assert(  oneOf!TestEnum(2) );
11 assert( !oneOf!TestEnum(3) );
12 assert(  oneOf!TestEnum(4) );
13 assert( !oneOf!TestEnum(5) );

Meta