Why is "array operation without destination memory not allowed"?

Lily yulex.42 at gmail.com
Sat Jan 6 23:08:14 UTC 2018


It seems a bit silly that I have to write

int[] a = [1, 2, 300, -29];
int[] b;
b.length = 4;
b[] = a[] * 2;
writeln(b);

to do what I would expect

int[] a = [1, 2, 300, -29];
writeln(a[] * 2);

to do. What am I not understanding?


More information about the Digitalmars-d-learn mailing list