isInterface

Checks if the object instance have implemented the given interface or not. Intended for avoiding typecasting incidents.

public @safe nothrow
bool
isInterface
(
I
)
(
Object o
)

Parameters

o Object

The object instance to be tested. Template params:

I

The interface type to check for.

Return Value

Type: bool

True if interface is implemented in the object instance, false otherwise.

Meta