---
title: "swapAt(unchecked:unchecked:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/outputspan/swapat(unchecked:unchecked:)"
---

# swapAt(unchecked:unchecked:)

Exchange the elements at the two given offsets

## Declaration

```swift
mutating func swapAt(unchecked i: OutputSpan<Element>.Index, unchecked j: OutputSpan<Element>.Index)
```

## Parameters

- `i`: A valid index into this span.
- `j`: A valid index into this span.

## Discussion

Discussion This function does not validate i or j; this is an unsafe operation.
