baseInterface

Deduces single base interface for a type. Multiple interfaces will result in compile-time error.

Members

Aliases

Ifaces
alias Ifaces = InterfacesTuple!T
Undocumented in source.
baseInterface
alias baseInterface = T
Undocumented in source.
baseInterface
alias baseInterface = Ifaces[0]
Undocumented in source.

Parameters

T

interface or class type

Return Value

T if it is an interface. If T is a class, interface it implements.

Examples

interface I1 {
}

class A : I1 {
}

interface I2 {
}

class B : I1, I2 {
}

static assert(is(baseInterface!I1 == I1));
static assert(is(baseInterface!A == I1));
static assert(!is(typeof(baseInterface!B)));

Meta