$(D_KEYWORD true) if pred(T) can be used as condition in an $(D_KEYWORD if)-statement or a ternary operator.
static assert(ifTestable!int); static struct S1 { } static assert(!ifTestable!S1); static struct S2 { bool opCast(T : bool)() { return true; } } static assert(ifTestable!S2);
Tests whether pred(T) can be used as condition in an $(D_KEYWORD if)-statement or a ternary operator.
pred is an optional parameter. By default $(D_PSYMBOL ifTestable) tests whether T itself is usable as condition in an $(D_KEYWORD if)-statement or a ternary operator, i.e. if it a value of type T can be converted to a boolean.