auto arr = New!(int[])(3); arr[0] = 1; arr[1] = 2; arr[2] = 3; reallocateArray(arr, 2); assert(arr.length == 2); assert(arr[0] == 1); assert(arr[1] == 2); reallocateArray(arr, 4); assert(arr.length == 4); assert(arr[0] == 1); assert(arr[1] == 2);
See Implementation