replaceRangeBounded
Grows or shrinks the list as necessary.
Never invalidates element pointers.
If the unused capacity is insufficient for additional items,
returns error.OutOfMemory.
Function parameters
Parameters
- self:*Self
- start:usize
- len:usize
- new_items:[]const T
Deprecated.
Functions
- Managed
- Deprecated.
- AlignedManaged
- Deprecated.
- Aligned
- A contiguous, growable list of arbitrarily aligned items in memory.
Source
Implementation
pub fn replaceRangeBounded(self: *Self, start: usize, len: usize, new_items: []const T) error{OutOfMemory}!void {
if (self.capacity - self.items.len < new_items.len -| len) return error.OutOfMemory;
return replaceRangeAssumeCapacity(self, start, len, new_items);
}