##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::swap(std::match_results)

From cppreference.com
< cpp‎ | regex‎ | match results

Defined in header `<regex>` |  |
template< class BidirIt, class Alloc > void swap( match_results<BidirIt,Alloc>& x1, match_results<BidirIt,Alloc>& x2 ); |  | (since C++11)

Specializes the std::swap algorithm for std::match_results. Exchanges the contents of `x1` with those of `x2`. Effectively calls x1.swap(x2).

### [edit] Parameters

x1, x2 | - | the match_results objects whose contents will be swapped
Type requirements
- `BidirIt` must meet the requirements of `BidirectionalIterator`.
- `Alloc` must meet the requirements of `Allocator`.

### [edit] Return value

(none)

### [edit] Exceptions

`noexcept` specification:
noexcept

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

swap | swaps the contents (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/regex/match_results/swap2&oldid=91625"
Categories:

- unconditionally noexcept
- Todo no example

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template