isOf

Checks if a certain literal or function return type is equal. Basically the same as is(... == ...) but resolves the function return type.

template isOf (
ab...
) if (
ab.length == 2
) {}

Members

Aliases

Ts
alias Ts = TypesOf!ab
Undocumented in source.

Manifest constants

isOf
enum isOf;
Undocumented in source.

Templates

resolve
template resolve(T)
Undocumented in source.

Examples

assertTrue(isOf!(int, 3));
assertTrue(isOf!(7, 3));
assertTrue(isOf!(3, int));
assertFalse(isOf!(float, 3));
assertFalse(isOf!(float, string));
assertFalse(isOf!(string, 3));

string foobar()
{
	return "";
}

assertTrue(isOf!(string, foobar));
// cover foobar()
assertEquals("", foobar());

// check static eval
static assert(isOf!(string, foobar));

Meta