CastTo

Finds the type in the TList which T can be typecast to

template CastTo (
T
TList...
) {}

Return Value

void if not type is found

Examples

static assert(is(void == CastTo!(string, AliasSeq!(int, long, double))));
static assert(is(double == CastTo!(float, AliasSeq!(int, long, double))));
static assert(is(string == CastTo!(string, AliasSeq!(uint, string))));
static assert(is(uint == CastTo!(ushort, AliasSeq!(uint, string))));
static assert(is(uint == CastTo!(int, AliasSeq!(string, uint))));
static assert(is(const(uint) == CastTo!(inout(uint), AliasSeq!(const(uint), const(string)))));