[#bsl-shared_ptr-0a-swap] = xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared_ptr]::swap :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bslstl_sharedptr.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(xref:bsl/shared_ptr-0a.adoc[shared_ptr]& other) noexcept; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#