DerivedToFront

Returns an AliasSeq with the elements of TList sorted so that the most derived types come first.

template DerivedToFront (
TList...
) {}

Examples

class A { }
class B : A { }
class C : B { }
alias Types = AliasSeq!(A, C, B);

alias TL = DerivedToFront!(Types);
static assert(is(TL == AliasSeq!(C, B, A)));

alias TL2 = DerivedToFront!(A, A, A, B, B, B, C, C, C);
static assert(is(TL2 == AliasSeq!(C, C, C, B, B, B, A, A, A)));

Meta