[stack.special] # 23 Containers library [[containers]](./#containers) ## 23.6 Container adaptors [[container.adaptors]](container.adaptors#stack.special) ### 23.6.6 Class template stack [[stack]](stack#special) #### 23.6.6.7 Specialized algorithms [stack.special] [🔗](#lib:swap,stack) `template constexpr void swap(stack& x, stack& y) noexcept(noexcept(x.swap(y))); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16893) *Constraints*: is_swappable_v is true[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L16897) *Effects*: As if by x.swap(y)[.](#2.sentence-1)