[#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_TYPE` with those of the specified `rhs` of the parameterized `RHS_TYPE`. Note that, if `LHS_TYPE` and `RHS_TYPE` are the same type and that type has the bit‐wise moveable trait but does not use `bslma` allocators, the swap can be performed using a three‐way bit‐wise move. == Synopsis Declared in `<bslalg_scalarprimitives.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class LHS_TYPE, class RHS_TYPE> static void swap( LHS_TYPE& lhs, RHS_TYPE& rhs); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#