pop
Function parameters
Parameters
- self:*Self
This is a stack data structure where pointers to indexes have the same lifetime as the data structure
Functions
- SegmentedList
- This is a stack data structure where pointers to indexes have the same lifetime as the data structure
Source
Implementation
pub fn pop(self: *Self) ?T {
if (self.len == 0) return null;
const index = self.len - 1;
const result = uncheckedAt(self, index).*;
self.len = index;
return result;
}