Automatic Foreach

BCS ao at pathlink.com
Sun Apr 27 13:46:56 PDT 2008


Reply to janderson,
> 
> float[] array;
> array ~= sqrt(array2);


how about


char[] to;
char[][] from;

to ~= from;

goes to

uint add=0;
foreach(a;from) add+=a.length;

to.length += add;

foreach(a;from)
{
 to[$-add,$-add+a.length = a[]
 add-= a.length;
}

??
 





More information about the Digitalmars-d mailing list