isOneOf

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

Return Value

true if the type T is one of types in the list TList

Examples

import std.meta;

alias Seq = AliasSeq!(long, int, ubyte);
static assert(isOneOf!(int, Seq));
static assert(!isOneOf!(double, Seq));