DoxigAlpha

appendBounded

Extend the list by 1 element.

Never invalidates element pointers.

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

Function parameters

Parameters

#
self:*Self
item:T

Deprecated.

Functions

#
Managed
Deprecated.
AlignedManaged
Deprecated.
Aligned
A contiguous, growable list of arbitrarily aligned items in memory.

Source

Implementation

#
pub fn appendBounded(self: *Self, item: T) error{OutOfMemory}!void {
    if (self.capacity - self.items.len == 0) return error.OutOfMemory;
    return appendAssumeCapacity(self, item);
}