[#absl-swap-00e]
= xref:absl.adoc[absl]::swap
:relfileprefix: ../
:mrdocs:

`swap` overloads

== Synopses

Declared in `&lt;absl&sol;status&sol;status&period;h&gt;`

swap()


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:absl/swap-0f9.adoc[swap](
    xref:absl/AnyInvocable.adoc[AnyInvocable]& f1,
    xref:absl/AnyInvocable.adoc[AnyInvocable]& f2) noexcept;
----

[.small]#xref:absl/swap-0f9.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two Cords&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:absl/swap-0d.adoc[swap](
    xref:absl/Cord.adoc[Cord]& x,
    xref:absl/Cord.adoc[Cord]& y) noexcept;
----

[.small]#xref:absl/swap-0d.adoc[_» more&period;&period;&period;_]#

Swaps the contents of one status with another&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:absl/swap-028.adoc[swap](
    xref:absl/Status.adoc[Status]& a,
    xref:absl/Status.adoc[Status]& b) noexcept;
----

[.small]#xref:absl/swap-028.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two inlined vectors&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    size&lowbar;t N,
    typename A&gt;
void
xref:absl/swap-0a.adoc[swap](
    xref:absl/InlinedVector.adoc[absl::InlinedVector&lt;T, N, A&gt;]& a,
    xref:absl/InlinedVector.adoc[absl::InlinedVector&lt;T, N, A&gt;]& b) noexcept(noexcept(a&period;swap(b)));
----

[.small]#xref:absl/swap-0a.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `absl&colon;&colon;btree&lowbar;multiset` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename C,
    typename A&gt;
void
xref:absl/swap-06.adoc[swap](
    xref:absl/btree_multiset.adoc[btree&lowbar;multiset&lt;K, C, A&gt;]& x,
    xref:absl/btree_multiset.adoc[btree&lowbar;multiset&lt;K, C, A&gt;]& y);
----

[.small]#xref:absl/swap-06.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `absl&colon;&colon;btree&lowbar;set` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename C,
    typename A&gt;
void
xref:absl/swap-0ef.adoc[swap](
    xref:absl/btree_set.adoc[btree&lowbar;set&lt;K, C, A&gt;]& x,
    xref:absl/btree_set.adoc[btree&lowbar;set&lt;K, C, A&gt;]& y);
----

[.small]#xref:absl/swap-0ef.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `absl&colon;&colon;btree&lowbar;map` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename V,
    typename C,
    typename A&gt;
void
xref:absl/swap-04.adoc[swap](
    xref:absl/btree_map.adoc[btree&lowbar;map&lt;K, V, C, A&gt;]& x,
    xref:absl/btree_map.adoc[btree&lowbar;map&lt;K, V, C, A&gt;]& y);
----

[.small]#xref:absl/swap-04.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `absl&colon;&colon;btree&lowbar;multimap` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename V,
    typename C,
    typename A&gt;
void
xref:absl/swap-000.adoc[swap](
    xref:absl/btree_multimap.adoc[btree&lowbar;multimap&lt;K, V, C, A&gt;]& x,
    xref:absl/btree_multimap.adoc[btree&lowbar;multimap&lt;K, V, C, A&gt;]& y);
----

[.small]#xref:absl/swap-000.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `absl&colon;&colon;chunked&lowbar;queue` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    size&lowbar;t BLo,
    size&lowbar;t BHi,
    typename Allocator&gt;
void
xref:absl/swap-027.adoc[swap](
    xref:absl/chunked_queue.adoc[chunked&lowbar;queue&lt;T, BLo, BHi, Allocator&gt;]& a,
    xref:absl/chunked_queue.adoc[chunked&lowbar;queue&lt;T, BLo, BHi, Allocator&gt;]& b) noexcept;
----

[.small]#xref:absl/swap-027.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `flat&lowbar;hash&lowbar;set` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename H,
    typename E,
    typename A&gt;
void
xref:absl/swap-0f6.adoc[swap](
    xref:absl/flat_hash_set.adoc[flat&lowbar;hash&lowbar;set&lt;T, H, E, A&gt;]& x,
    xref:absl/flat_hash_set.adoc[flat&lowbar;hash&lowbar;set&lt;T, H, E, A&gt;]& y) noexcept(noexcept(x&period;swap(y)));
----

[.small]#xref:absl/swap-0f6.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `node&lowbar;hash&lowbar;set` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename H,
    typename E,
    typename A&gt;
void
xref:absl/swap-0fd.adoc[swap](
    xref:absl/node_hash_set.adoc[node&lowbar;hash&lowbar;set&lt;T, H, E, A&gt;]& x,
    xref:absl/node_hash_set.adoc[node&lowbar;hash&lowbar;set&lt;T, H, E, A&gt;]& y) noexcept(noexcept(x&period;swap(y)));
----

[.small]#xref:absl/swap-0fd.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `flat&lowbar;hash&lowbar;map` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename V,
    typename H,
    typename E,
    typename A&gt;
void
xref:absl/swap-03.adoc[swap](
    xref:absl/flat_hash_map.adoc[flat&lowbar;hash&lowbar;map&lt;K, V, H, E, A&gt;]& x,
    xref:absl/flat_hash_map.adoc[flat&lowbar;hash&lowbar;map&lt;K, V, H, E, A&gt;]& y) noexcept(noexcept(x&period;swap(y)));
----

[.small]#xref:absl/swap-03.adoc[_» more&period;&period;&period;_]#

Swaps the contents of two `node&lowbar;hash&lowbar;map` containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename K,
    typename V,
    typename H,
    typename E,
    typename A&gt;
void
xref:absl/swap-0e2.adoc[swap](
    xref:absl/node_hash_map.adoc[node&lowbar;hash&lowbar;map&lt;K, V, H, E, A&gt;]& x,
    xref:absl/node_hash_map.adoc[node&lowbar;hash&lowbar;map&lt;K, V, H, E, A&gt;]& y) noexcept(noexcept(x&period;swap(y)));
----

[.small]#xref:absl/swap-0e2.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *f1*
| The first `AnyInvocable` to swap&period;
| *f2*
| The second `AnyInvocable` to swap&period;
| *x*
| The first Cord&period;
| *y*
| The second Cord&period;
| *a*
| The first status&period;
| *b*
| The second status&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
