Assign rhs to this array. The current array will now become another
reference to rhs, unless rhs is null, in which case the current
array will become empty. If rhs refers to the current array nothing will
happen.
If there are no more references to the previous array, the previous
array will be destroyed; this leads to a O(n) complexity.
importstd.algorithm.comparison : equal;
autoa = Array!int(1);
autoa2 = Array!int(1, 2);
a = a2; // this will free the old aassert(equal(a, [1, 2]));
a.front = 0;
assert(equal(a2, [0, 2]));
Assign rhs to this array. The current array will now become another reference to rhs, unless rhs is null, in which case the current array will become empty. If rhs refers to the current array nothing will happen.
If there are no more references to the previous array, the previous array will be destroyed; this leads to a O(n) complexity.