[#bsl-shared_ptr-0a-swap]
= xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]::swap
:relfileprefix: ../../
:mrdocs:

Exchange the state of this `shared&lowbar;ptr` with `other`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]& other) noexcept;
----

== Description

Efficiently exchange the states of this shared pointer and the specified `other` shared pointer such that each will refer to the object formerly referred to by the other and each will manage the object formerly managed by the other&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| other pointer to compare or share ownership with
|===


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