DoxigAlpha

orderedRemove

Remove the element at index i, shift elements after index i forward, and return the removed element. Invalidates element pointers to end of list. This operation is O(N). This preserves item order. Use swapRemove if order preservation is not important. Asserts that the index is in bounds. Asserts that the list is not empty.

Function parameters

Parameters

#
self:*Self
i:usize

Deprecated.

Functions

#
Managed
Deprecated.
AlignedManaged
Deprecated.
Aligned
A contiguous, growable list of arbitrarily aligned items in memory.

Source

Implementation

#
pub fn orderedRemove(self: *Self, i: usize) T {
    const old_item = self.items[i];
    self.replaceRangeAssumeCapacity(i, 1, &.{});
    return old_item;
}