# std::match_results<BidirIt,Alloc>::swap

> C++ Atlas: `cppatlas.com/w/cpp/regex/match_results/swap` | Source: https://en.cppreference.com/w/cpp/regex/match_results/swap | Domain: Regular expressions | Standards: C++11

Exchanges the shared states of two match_results objects.

## Official Specification Summary (cppreference)

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

Exchanges the shared states of two `match_results` objects.

### Parameters

- `other` - the `match_results` to swap with

### Return value

(none)

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`std::swap(std::match_results)`](https://en.cppreference.com/w/cpp/regex/match_results/swap2) (C++11): specializes the `std::swap` algorithm (function template)

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