DoxigAlpha

addManyAt

Add count new elements at position index, which have undefined values. Returns a slice pointing to the newly allocated elements, which becomes invalid after various ArrayList operations. Invalidates pre-existing pointers to elements at and after index. Invalidates all pre-existing element pointers if capacity must be increased to accommodate the new elements. Asserts that the index is in bounds or equal to the length.

Function parameters

Parameters

#
self:*Self
index:usize
count:usize

Deprecated.

Functions

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

Source

Implementation

#
pub fn addManyAt(
    self: *Self,
    gpa: Allocator,
    index: usize,
    count: usize,
) Allocator.Error![]T {
    var managed = self.toManaged(gpa);
    defer self.* = managed.moveToUnmanaged();
    return managed.addManyAt(index, count);
}