pub fn insertSliceBounded(
self: *Self,
index: usize,
items: []const T,
) error self: *Selfindex: usizeitems: []const T962
963
964
965
966
967
968
969 pub fn insertSliceBounded(
self: *Self,
index: usize,
items: []const T,
) error{OutOfMemory}!void {
const dst = try self.addManyAtBounded(index, items.len);
@memcpy(dst, items);
}
Insert slice
itemsat indexindexby movinglist[index .. list.len]to make room. This operation is O(N). 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.