Return slice of all elements (same as Vector.elements).
The slice returned may be invalidated by further calls to other member functions that modify the object.
Vector!(int, 6) vec = Vector!(int, 6).build(1, 2, 3); int[] slice = vec[]; assert(slice.length == vec.length); assert(slice.ptr is vec.ptr); vec.reserve(vec.capacity * 2); assert(slice.length == vec.length); // slice contains dangling pointer!
See Implementation
Return slice of all elements (same as Vector.elements).
The slice returned may be invalidated by further calls to other member functions that modify the object.