DoxigAlpha

addOneBounded

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.

If the list lacks unused capacity for the additional item, returns error.OutOfMemory.

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 addOneBounded(self: *Self) error{OutOfMemory}!*T {
    if (self.capacity - self.items.len < 1) return error.OutOfMemory;
    return addOneAssumeCapacity(self);
}