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

Exchange the targets held by the specified `a` and `b` functions&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class PROTOTYPE&gt;
void
swap(
    xref:bsl/function-0a.adoc[function&lt;PROTOTYPE&gt;]& a,
    xref:bsl/function-0a.adoc[function&lt;PROTOTYPE&gt;]& b) noexcept;
----

== Description

The behavior is undefined unless &grave;a&period;get&lowbar;allocator() &equals;&equals; b&period;get&lowbar;allocator()&grave;&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| first function participating in the swap
| *b*
| second function participating in the swap
|===


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