Hi There,
I am trying to switch between two structs as I am using the
csvReader on a raw string. The pseudo-code below throws a "cannot
implicitly convert" error due to difference between struct_type1
and struct_type2. I must be doing something wrong or have a wrong
understanding of how this function works. Could someone give a
good suggestion on handling this?
Thanks!
Best,
Selim
auto records = rawtext.csvReader!struct_type1(';');
if(aControlCondition) {
records = rawtext.csvReader!struct_type2(';');
}
// Iterate through each data row.
foreach (record; records) {
writeln(record);
}