Two options: do allMembers and filter it out to only be data members, or do some slicing of tupleof.stringof:

S s;
foreach(idx, member; s.tupleof) {
   writeln("Name: ", s.tupleof[idx].stringof[2..$]);
}


The tupleof[idx] inside the loop is important instead of just using member because then you get the name, then the slicing is because you get:

s.foo

for example, and you want to slice off the "s." to leave just the name.

Reply via email to