Function resizeArray
Parameters
Name | Description |
---|---|
T | Element type of the array being created. |
allocator | The allocator used for getting memory. |
array | A reference to the array being changed. |
length | New array length. |
Returns
true upon success, false if memory could not be reallocated. In the latter
Example
int[] p;
defaultAllocator .resizeArray(p, 20);
assert(p .length == 20);
defaultAllocator .resizeArray(p, 30);
assert(p .length == 30);
defaultAllocator .resizeArray(p, 10);
assert(p .length == 10);
defaultAllocator .resizeArray(p, 0);
assert(p is null);