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

Swap the contents of the specified `lhs` of the parameterized `LHS&lowbar;TYPE` with those of the specified `rhs` of the parameterized `RHS&lowbar;TYPE`&period; Note that, if `LHS&lowbar;TYPE` and `RHS&lowbar;TYPE` are the same type and that type has the bit&hyphen;wise moveable trait but does not use `bslma` allocators, the swap can be performed using a three&hyphen;way bit&hyphen;wise move&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LHS&lowbar;TYPE,
    class RHS&lowbar;TYPE&gt;
static
void
swap(
    LHS&lowbar;TYPE& lhs,
    RHS&lowbar;TYPE& rhs);
----


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