Contents

insert(moving:at:)

Moves the elements of an output span into this array, starting at the specified position, and leaving the span empty.

Declaration

mutating func insert(moving items: inout OutputSpan<Element>, at index: Int)

Parameters

  • items:

    An output span whose contents to move into the array.

  • index:

    The position at which to insert the new items. index must be a valid index in the array.

Discussion

All existing elements at or following the specified position are moved to make room for the new items.

If the array does not have sufficient capacity to hold the new elements, then this reallocates storage to extend its capacity, using a geometric growth rate.