Requests the Vector to reduce its capacity to fit its length.
The request is non-binding.
This function has no effect on the vector length and cannot alter its content.
Vector!(int, 6) vec = Vector!(int, 6).build(1, 2, 3); assert(vec.capacity == typeof(vec).minimalCapacity); vec.reserve(vec.capacity * 2); assert(vec.capacity > typeof(vec).minimalCapacity); vec.shrinkToFit(); assert(vec.capacity == typeof(vec).minimalCapacity);
See Implementation
Requests the Vector to reduce its capacity to fit its length.
The request is non-binding.
This function has no effect on the vector length and cannot alter its content.