var.isBool

bool isBool() @property const nothrow @nogc pure @safe

Check if this value is a boolean (Type.BOOL).

More readable alternative to v.type == var.Type.BOOL.

Returns

true if the value is a boolean, false otherwise.

Examples

var b = true;
assert(b.isBool);
var i = 42;
assert(!i.isBool);