Iterate module membres

crimaniak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 7 01:46:54 PST 2017


Hi!

I need to iterate module members and find specific classes (and 
make tuple).

     class foo{};
     pragma (msg, __traits(allMembers,mixin(__MODULE__)));

gives me empty tuple. I found also this thread from 2011: 
http://forum.dlang.org/post/mailman.325.1293887146.4748.digitalmars-d-learn@puremagic.com
This is exactly what I need but this code also gives empty tuple.
Is this possible for now to iterate classes from module? Is this 
possible to iterate by classes, public imported to module? (in 
fact, I need to iterate classes imported using package.d file).





More information about the Digitalmars-d-learn mailing list