[#BloombergLP-bsltf-swap-08]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::swap
:relfileprefix: ../../
:mrdocs:

`swap` overloads

== Synopses

Declared in `&lt;bsltf&lowbar;degeneratefunctor&period;h&gt;`

Exchange the states of two objects&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bsltf/swap-06.adoc[swap](
    xref:BloombergLP/bsltf/MoveOnlyAllocTestType.adoc[MoveOnlyAllocTestType]& a,
    xref:BloombergLP/bsltf/MoveOnlyAllocTestType.adoc[MoveOnlyAllocTestType]& b);
----

[.small]#xref:BloombergLP/bsltf/swap-06.adoc[_» more&period;&period;&period;_]#

Exchange the states of the specified `a` and `b`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bsltf/swap-0f.adoc[swap](
    xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType.adoc[WellBehavedMoveOnlyAllocTestType]& a,
    xref:BloombergLP/bsltf/WellBehavedMoveOnlyAllocTestType.adoc[WellBehavedMoveOnlyAllocTestType]& b);
----

[.small]#xref:BloombergLP/bsltf/swap-0f.adoc[_» more&period;&period;&period;_]#

Exchange the values of the specified `lhs` and `rhs` objects&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FUNCTOR&gt;
void
xref:BloombergLP/bsltf/swap-02.adoc[swap](
    xref:BloombergLP/bsltf/DegenerateFunctor.adoc[DegenerateFunctor&lt;FUNCTOR, true&gt;]& lhs,
    xref:BloombergLP/bsltf/DegenerateFunctor.adoc[DegenerateFunctor&lt;FUNCTOR, true&gt;]& rhs);
----

[.small]#xref:BloombergLP/bsltf/swap-02.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| first object to swap
| *b*
| second object to swap
| *lhs*
| left&hyphen;hand operand
| *rhs*
| right&hyphen;hand operand
|===


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