[#BloombergLP-bslalg-SwapUtil-swap]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/SwapUtil.adoc[SwapUtil]::swap
:relfileprefix: ../../../
:mrdocs:

Exchange the values of the specified `a` and `b` objects using either a `swap` free function overloaded for type `T`, in the namespace of type `T` if it&apos;s available, and the default generic `bsl&colon;&colon;swap` otherwise&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;swaputil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
static
void
swap(
    T* a,
    T* b);
----


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