Change the current capacity of the array to new_capacity.
This can enlarge or shrink the array, depending on the current capacity.
If new_capacity is 0, the array is enlarged to hold double the current
size. If new_capacity is less than the current size, the current size is
truncated, and the (size - new_capacity) elements at the end are lost.
Returns true if the resize was successful, false otherwise (and the
internal state is not changed).
Change the current capacity of the array to new_capacity.
This can enlarge or shrink the array, depending on the current capacity. If new_capacity is 0, the array is enlarged to hold double the current size. If new_capacity is less than the current size, the current size is truncated, and the (size - new_capacity) elements at the end are lost.
Returns true if the resize was successful, false otherwise (and the internal state is not changed).