DoxigAlpha

pop

Remove and return the last element from the list. If the list is empty, returns null. Invalidates pointers to last element.

Function parameters

Parameters

#
self:*Self

Deprecated.

Functions

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

Source

Implementation

#
pub fn pop(self: *Self) ?T {
    if (self.items.len == 0) return null;
    const val = self.items[self.items.len - 1];
    self.items.len -= 1;
    return val;
}