On 2012-10-17 20:36, Tyler Jameson Little wrote:

The mentioned solution doesn't account for shared fields from a super
class:

     class A { int a; }
     class S { int b; }

     foreach (i, type; typeof(S.tupleof)) {
         enum name = S.tupleof[i].stringof[4..$];
         writef("(%s) %s\n", type.stringof, name);
     }

This will print:

     (int) b

Just do something like this:

alias BaseTypeOf!(S) BaseType;
BaseType t = type;

And run the same loop again.

--
/Jacob Carlborg

Reply via email to