Q: Populating a structure with RTTI

Lutger lutger.blijdestijn at gmail.com
Mon Jun 11 08:12:18 PDT 2007


Myron Alexander wrote:
>>       /+ Won't compile:
>>       for (int i = 0; i < T.tupleof.length; i++) {
>>          t.tupleof[i] = r.t[i];
>>       }
>>       +/

You can use foreach on tuples:

foreach(index, value; r.t)
     t.tupleof[index] = value;


More information about the Digitalmars-d-learn mailing list