addManyAtBounded
Add count new elements at position index, which have
undefined values, returning a slice pointing to the newly
allocated elements, which becomes invalid after various ArrayList
operations.
Invalidates pre-existing pointers to elements at and after index, but
does not invalidate any before that.
If the list lacks unused capacity for the additional items, returns
error.OutOfMemory.
Asserts that the index is in bounds or equal to the length.
Function parameters
Parameters
- self:*Self
- index:usize
- count:usize
Deprecated.
Functions
- Managed
- Deprecated.
- AlignedManaged
- Deprecated.
- Aligned
- A contiguous, growable list of arbitrarily aligned items in memory.
Source
Implementation
pub fn addManyAtBounded(self: *Self, index: usize, count: usize) error{OutOfMemory}![]T {
if (self.capacity - self.items.len < count) return error.OutOfMemory;
return addManyAtAssumeCapacity(self, index, count);
}