pub fn addManyAsSliceBounded(self: *Self, n: usize) error self: *Selfn: usize1488
1489
1490
1491 pub fn addManyAsSliceBounded(self: *Self, n: usize) error{OutOfMemory}![]T {
if (self.capacity - self.items.len < n) return error.OutOfMemory;
return addManyAsSliceAssumeCapacity(self, n);
}
Resizes the array, adding
nnew elements, which haveundefinedvalues, returning a slice 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.