import std.stdio;
void main(){
int [] a = [1,2,3,4,5];
int [] b = a;
writeln(b, " ", a);
a.reverse;
writeln(b, " ", a);
}
I get:
[1, 2, 3, 4, 5] [1, 2, 3, 4, 5]
[5, 4, 3, 2, 1] [5, 4, 3, 2, 1]
Why is also b flipped here? This doesn't happen if I use static
arrays.