TransitiveBaseTypeTuple

Returns a tuple of all base classes and interfaces of T.

$(D_PSYMBOL TransitiveBaseTypeTuple) returns first the parent class, then grandparent and so on. The last class is $(D_PSYMBOL Object). Then the interfaces follow.

template TransitiveBaseTypeTuple (
T
) if (
is(T == class) ||
is(T == interface)
) {}

Members

Aliases

TransitiveBaseTypeTuple
alias TransitiveBaseTypeTuple = NoDuplicates!(Sort!(cmp, Impl!T))
Undocumented in source.

Parameters

T

Class or interface type.

Return Value

A tuple of all base classes and interfaces of ($D_PARAM T).

Examples

interface I1
{
}
interface I2 : I1
{
}
class A : I2
{
}
class B : A, I1
{
}
class C : B, I2
{
}
alias Expected = AliasSeq!(B, A, Object, I2, I1);
static assert(is(TransitiveBaseTypeTuple!C == Expected));

static assert(is(TransitiveBaseTypeTuple!Object == AliasSeq!()));
static assert(is(TransitiveBaseTypeTuple!I2 == AliasSeq!(I1)));

See Also

$(D_PSYMBOL BaseTypeTuple).

Meta