pub fn addManyAtBounded(self: *Self, index: usize, count: usize) error self: *Selfindex: usizecount: usize917
918
919
920 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);
}
Add
countnew elements at positionindex, which haveundefinedvalues, returning a slice pointing to the newly allocated elements, which becomes invalid after variousArrayListoperations. Invalidates pre-existing pointers to elements at and afterindex. If the list lacks unused capacity for the additional items, returnserror.OutOfMemory. Asserts that the index is in bounds or equal to the length.