class C
{
    this(){ _i = 0; _j = 0; }
    void setVar(int i) { _i = i; }
    int getVar() { return _i; }
    int _i;
    int _j;
}

writeln("C");
foreach( i, str; myClassMembers)
{
    writeln("    member ", i, " = ", str);
    TypeInfo ti = typeid(str);
    writeln("    type id is ", ti);
    writeln("    type is ", typeof(str).stringof);
}


C
    member 0 = __ctor
    type id is immutable(char)[]
    type is string
    member 1 = _i
    type id is immutable(char)[]
    type is string
    member 2 = setVar
    type id is immutable(char)[]
    type is string
    member 3 = getVar
    type id is immutable(char)[]
    type is string
     . . .
    the same all the way through the class

I'm trying to get at least the type int for the _i member? Also, is there a way to get __traits(allMembers to work recursively? Say, with struct containing structs.

Thanks,
kyle




Reply via email to