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
Increase length by 1, returning pointer to the new item. Invalidates element pointers if additional memory is needed. The returned pointer may be invalidated by further operations to this list.
pubfnaddOne(self: *Self) Allocator.Error!*T {
// This can never overflow because `self.items` can never occupy the whole address spaceconstnewlen = self.items.len + 1;
tryself.ensureTotalCapacity(newlen);
returnself.addOneAssumeCapacity();
}
Increase length by 1, returning pointer to the new item. Invalidates element pointers if additional memory is needed. The returned pointer may be invalidated by further operations to this list.