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

orderedRemove

Public Function
std.multi_array_list.MultiArrayList.orderedRemove
pub fn orderedRemove(self: *Self, index: usize) void

Remove the specified item from the list, shifting items after it to preserve order.

Params

  • self: *Self
  • index: usize

File

multi_array_list.zig:399
399
400
401
402
403
404
405
406
407
408
409
410
        pub fn orderedRemove(self: *Self, index: usize) void {
            const slices = self.slice();
            inline for (field_names, 0..) |_, field_index| {
                const field_slice = slices.items(@as(Field, @fromBackingInt(@intCast(field_index))));
                var i = index;
                while (i < self.len - 1) : (i += 1) {
                    field_slice[i] = field_slice[i + 1];
                }
                field_slice[i] = undefined;
            }
            self.len -= 1;
        }