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

Swap the values of the specified `a` and `b` pairs&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T1,
    class T2&gt;
void
swap(
    xref:bsl/pair-0b.adoc[pair&lt;T1, T2&gt;]& a,
    xref:bsl/pair-0b.adoc[pair&lt;T1, T2&gt;]& b) noexcept(noexcept(a&period;swap(b)))
requires bsl&colon;&colon;is&lowbar;swappable&lt;T1&gt;&colon;&colon;value &amp;&amp; bsl&colon;&colon;is&lowbar;swappable&lt;T2&gt;&colon;&colon;value;
----

== Description

Swap the values of the specified `a` and `b` pairs by applying `swap` to each of the `first` and `second` pair fields&period; Note that this method is no&hyphen;throw only if `swap` on each field is no&hyphen;throw&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| first pair to exchange
| *b*
| second pair to exchange
|===


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