42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
[tuple.special]
|
|
|
|
# 22 General utilities library [[utilities]](./#utilities)
|
|
|
|
## 22.4 Tuples [[tuple]](tuple#special)
|
|
|
|
### 22.4.12 Tuple specialized algorithms [tuple.special]
|
|
|
|
[ð](#lib:swap,tuple)
|
|
|
|
`template<class... Types>
|
|
constexpr void swap(tuple<Types...>& x, tuple<Types...>& y) noexcept(see below);
|
|
template<class... Types>
|
|
constexpr void swap(const tuple<Types...>& x, const tuple<Types...>& y) noexcept(see below);
|
|
`
|
|
|
|
[1](#1)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L3142)
|
|
|
|
*Constraints*:
|
|
|
|
- [(1.1)](#1.1)
|
|
|
|
For the first overload,(is_swappable_v<Types> && ...) is true[.](#1.1.sentence-1)
|
|
|
|
- [(1.2)](#1.2)
|
|
|
|
For the second overload,(is_swappable_v<const Types> && ...) is true[.](#1.2.sentence-1)
|
|
|
|
[2](#2)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L3153)
|
|
|
|
*Effects*: As if by x.swap(y)[.](#2.sentence-1)
|
|
|
|
[3](#3)
|
|
|
|
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L3157)
|
|
|
|
*Remarks*: The exception specification is equivalent to:noexcept(x.swap(y))
|