addManyAsArrayBounded
Resize the array, adding n new elements, which have undefined values.
The return value is an array pointing to the newly allocated elements.
Never invalidates element pointers.
The returned pointer becomes invalid when the list is resized.
If the list lacks unused capacity for the additional items, returns
error.OutOfMemory.
Function parameters
Parameters
- self:*Self
- n:usize
Deprecated.
Functions
- Managed
- Deprecated.
- AlignedManaged
- Deprecated.
- Aligned
- A contiguous, growable list of arbitrarily aligned items in memory.
Source
Implementation
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);
}