# std::valarray<T>::swap

> C++ Atlas: `cppatlas.com/w/cpp/numeric/valarray/swap` | Source: https://en.cppreference.com/w/cpp/numeric/valarray/swap | Domain: Numerics | Standards: C++11

Swaps the contents with those of other.

## Official Specification Summary (cppreference)

```cpp
void swap( valarray& other ); // (until C++11)
void swap( valarray& other ) noexcept; // (since C++11)
```

Swaps the contents with those of `other`.

### Parameters

- `other` - another valarray to swap the contents with

### Return value

(none)

---
Attribution: content from https://en.cppreference.com/w/cpp/numeric/valarray/swap (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.