# std::stop_source::swap

> C++ Atlas: `cppatlas.com/w/cpp/thread/stop_source/swap` | Source: https://en.cppreference.com/w/cpp/thread/stop_source/swap | Domain: Concurrency support | Standards: C++20

Exchanges the stop-state of *this and other.

## Official Specification Summary (cppreference)

```cpp
void swap( std::stop_source& other ) noexcept; // (since C++20)
```

Exchanges the stop-state of `*this` and `other`.

### Parameters

- `other` - `stop_source` to exchange the contents with

### Return value

(none)

---
Attribution: content from https://en.cppreference.com/w/cpp/thread/stop_source/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.