array operations enhancements

F. Almeida francisco.m.almeida at gmail.com
Tue Aug 17 23:41:42 PDT 2010


It is an excellent feature of D2 that one can do

double a[];
double b[];
double c[];

//...

c = a[] + 2.0*b[];

But this is still limited, as we cannot include function calls in
these operations.

What if the compiler was able to introduce them in the assignment
loop, provided that the functions pass ref double (in this case)?

double anyfun(ref double x) { ... }

c = anyfun(a[]) + 2.0*b[];


More information about the Digitalmars-d mailing list