reallocateArray

Undocumented in source. Be warned that the author may not have intended to support it.
void
reallocateArray
(
T
)
(
ref T[] buffer
,
const(size_t) len
)

Examples

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);

Meta