Derived classes? Reflection

Namespace rswhite4 at googlemail.com
Sat Apr 13 10:35:00 PDT 2013


On Saturday, 13 April 2013 at 16:16:03 UTC, Tofu Ninja wrote:
> Currently is there a way to get all of the subclasses of a 
> class at compile time?
> It seems like something that should be possible using traits 
> but I can't seems to see how.
>
> Something like
>
> class A{...}
> class B:A{...}
> class C:A{...}
>
> ...
>
> foreach(auto t ; getsubclass(A))
> {
>    ...
> }
>
> Any help would be grateful.
> Tofu

Maybe this is helpfully:
http://forum.dlang.org/thread/scgjnudclnwlbdqqdsyn@forum.dlang.org


More information about the Digitalmars-d-learn mailing list