On Wednesday, 22 February 2017 at 18:34:26 UTC, houdoux09 wrote:
void Read(T)(T value)
{
   foreach(i, mm; value.tupleof)
   {
writeln(__traits(identifier, value.tupleof[i]), " = ", mm);

      if(isArray!(typeof(mm)))
      {
          Read(mm[0]); //Error
      }
   }
}

You need to use "static if" here inside foreach. Otherwise the body of your "if" gets compiled for all the different fields of "value" and of course fails for the fields that are not arrays.

Reply via email to