Can you do this in D?

Wes ffhighwind at hotmail.com
Thu Jul 26 05:17:22 PDT 2012


> In general, no. But you can get a list of all members in a 
> module or class scope. Just use __traits(allMembers, ...);
The allMembers example was lacking fields. It only showed 
methods, so I wasn't really sure. The problem with it was that it 
returned strings. I suppose I can still use them in a mixin.

> Yes, if __traits doesn't work it works with .tupleof. For 
> serialization Orange is available:
>
> https://github.com/jacob-carlborg/orange
Awesome. Definitely sounds like what I'm looking for.


More information about the Digitalmars-d mailing list