Function

insert(_:at:)

Inserts source at index.

Source
fun insert(
   _ source: sink Element,
   at index: Int
) { inout }

Details

The new element is inserted before the element currently at index. If index is equal to count(), the new element is added at the end of the array.

Preconditions

  • index is in the range 0 ..< count().

Complexity

O(n), where n is the number of elements in self.