I am logging arbitrary POD struct types with member names and data:

void printStructInfo( T )( T info ) {
  foreach( i, A; typeof( T.tupleof )) {
    enum attribName = T.tupleof[i].stringof;
writefln( "%s : %s", attribName, mixin( "info." ~ attribName ));
  }
}

Is there is some other way to evaluate info.attribName without using string mixins?

Cheers, PP

Reply via email to