DoxigAlpha

addOneAssumeCapacity

Increase length by 1, returning pointer to the new item.

Never invalidates element pointers.

The returned element pointer becomes invalid when the list is resized.

Asserts that the list can hold one additional item.

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 addOneAssumeCapacity(self: *Self) *T {
    assert(self.items.len < self.capacity);

    self.items.len += 1;
    return &self.items[self.items.len - 1];
}