Function Vector.release

Erases and deallocate the contents of the Vector, which becomes an empty vector (with a length of 0 elements).

void release() nothrow scope;

Examples

Vector!(int, 6) vec = Vector!(int, 6).build(1, 2, 3);

vec.reserve(vec.capacity * 2);
assert(vec.length == 3);

const size_t cap = vec.capacity;
vec.clear();
assert(vec.capacity == cap);

vec.release();
assert(vec.capacity < cap);
assert(vec.capacity == typeof(vec).minimalCapacity);