The OpenD Programming Language

MostDerived

Returns the type from TList that is the most derived from type T. If no such type is found, T is returned.

Examples

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

MostDerived!(Object, Types) x;  // x is declared as type C
static assert(is(typeof(x) == C));

Meta