The OpenD Programming Language

isOneOf

Checks whether TargetType matches any subsequent types. Use as: isOneOf!(TargetType, Type1, Type2..);

template isOneOf (
X
T...
) {
static if(!T.length)
enum bool isOneOf;
static if(!(!T.length))
static if(is(X == T[0]))
enum bool isOneOf;
static if(!(!T.length))
static if(!(is(X == T[0])))
enum bool isOneOf;
}

Meta