Iterate module membres

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 7 02:27:51 PST 2017


On Saturday, 7 January 2017 at 09:46:54 UTC, crimaniak wrote:
> 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).

Do you require a module statement per chance?


More information about the Digitalmars-d-learn mailing list