[variant.specalg]

# 22 General utilities library [[utilities]](./#utilities)

## 22.6 Variants [[variant]](variant#specalg)

### 22.6.10 Specialized algorithms [variant.specalg]

[ð](#lib:swap,variant)

`template<class... Types>
  constexpr void swap(variant<Types...>& v, variant<Types...>& w) noexcept(see below);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L6947)

*Constraints*: is_move_constructible_v<Ti> && is_swappable_v<Ti> is true for all i[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L6952)

*Effects*: Equivalent to v.swap(w)[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L6956)

*Remarks*: The exception specification is equivalent to noexcept(v.swap(w))[.](#3.sentence-1)
