isClass

Check if the object instance is of a certain class, inherited from it, or not. Intended for avoiding typecasting incidents.

public @safe nothrow
bool
isClass
(
C
)
(
Object o
)

Parameters

o Object

The object instance to be tested. Template params:

C

The class type to check for.

Return Value

Type: bool

True if the class is of a given type or have inherited from it, false otherwise.

Meta