swapAt(_:_:)
Exchanges the values at the specified indices of the array.
Declaration
mutating func swapAt(_ i: InlineArray<count, Element>.Index, _ j: InlineArray<count, Element>.Index)Parameters
- i:
The index of the first value to swap.
- j:
The index of the second value to swap.
Discussion
Both parameters must be valid indices of the array and not equal to endIndex. Passing the same index as both i and j has no effect.