Reflection: Get all inherited classes of a base class

Philippe Sigaud philippe.sigaud at gmail.com
Sun Dec 23 02:07:33 PST 2012


> It looks like the runtime _does_ give you this capability (as Adam
> explains in
> his reponse), so I stand corrected on that point. But a compile time
> solution
> is still impossible due to D's compilation model.


A possible, partial solution is to get a module members at compile-time and
iterate on them to see if they are subclasses of A. That's partial for the
reasons you cited, but that might be enough for the OP.

I don't remember: is there a way to get all visible symbols in the current
scope?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20121223/86d1bf90/attachment.html>


More information about the Digitalmars-d-learn mailing list