Find out most derived class in base class

Kagamin spam at here.lot
Sat Nov 20 11:18:09 PST 2010


Michal Minich Wrote:

> On Fri, 19 Nov 2010 20:50:13 +0000, Michal Minich wrote:
> 
> > How do I solve this, without parametrizing class.
> > 
> > class Base {
> >     void foo () { I want get somehow to type *Derived2* at CT }
> > }
> > 
> > class Derived1 : Base { }
> > class Derived2 : Base { }
> 
> By making mistake, I realized that it is not possible :) The last line 
> should be:
> 
> class Derived2 : Derived1 { }
> 
> The *Base* has two most derived classes in the first example.
> 
> Anyway, is it somehow possible to iterate derived classes if I only know 
> base class? At CT.

__traits(allMembers, moduleWithDerivedClasses)
iterate over them and check


More information about the Digitalmars-d-learn mailing list