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));
Checks if a certain literal or function return type is equal. Basically the same as is(... == ...) but resolves the function return type.