Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

replaceRangeBounded

Public Function
std.array_list.Aligned.replaceRangeBounded
pub fn replaceRangeBounded(
            self: *Self,
            start: usize,
            len: usize,
            new_items: []const T,
        ) error

Invalidates pointers to elements at and above index start + len when len and new_items.len are unequal. If the unused capacity is insufficient for additional items, returns error.OutOfMemory.

Params

  • self: *Self
  • start: usize
  • len: usize
  • new_items: []const T

File

array_list.zig:1011
1011
1012
1013
1014
1015
1016
1017
1018
1019
        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);
        }