pop
Remove and return the last element from the list, or return null if list is empty.
Invalidates pointers to fields of the removed element.
Function parameters
Parameters
- self:*Self
A MultiArrayList stores a list of a struct or tagged union type.
Functions
- MultiArrayList
- A MultiArrayList stores a list of a struct or tagged union type.
Source
Implementation
pub fn pop(self: *Self) ?T {
if (self.len == 0) return null;
const val = self.get(self.len - 1);
self.len -= 1;
return val;
}