[#bsl-pair-0b-swap]
= xref:bsl.adoc[bsl]::xref:bsl/pair-0b.adoc[pair]::swap
:relfileprefix: ../../
:mrdocs:

Swap the value of this pair with the value of the specified `other` pair by applying `swap` to each of the `first` and `second` pair fields&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;pair&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(xref:bsl/pair-0b.adoc[pair]& other) noexcept(&sol;&ast; see-below &ast;&sol;);
----

== Exception specification

This function is potentially-throwing unless `bsl&colon;&colon;is&lowbar;nothrow&lowbar;swappable&lt;T1&gt;&colon;&colon;value &amp;&amp; bsl&colon;&colon;is&lowbar;nothrow&lowbar;swappable&lt;T2&gt;&colon;&colon;value`.

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| pair whose value is exchanged with this pair&apos;s value
|===


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