pub fn addManyAsArrayBounded(self: *Self, comptime n: usize) error self: *Selfn: usize1455
1456
1457
1458 pub fn addManyAsArrayBounded(self: *Self, comptime n: usize) error{OutOfMemory}!*[n]T {
if (self.capacity - self.items.len < n) return error.OutOfMemory;
return addManyAsArrayAssumeCapacity(self, n);
}
Resize the array, adding
nnew elements, which haveundefinedvalues. The return value is an array pointing to the newly allocated elements. Never invalidates element pointers. The returned pointer may be invalidated by further operations to this list. If the list lacks unused capacity for the additional items, returnserror.OutOfMemory.