[#BloombergLP-bsltf-swap-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::swap :relfileprefix: ../../ :mrdocs: Exchange the states of two objects. == Synopsis Declared in `<bsltf_moveonlyalloctesttype.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap( xref:BloombergLP/bsltf/MoveOnlyAllocTestType.adoc[MoveOnlyAllocTestType]& a, xref:BloombergLP/bsltf/MoveOnlyAllocTestType.adoc[MoveOnlyAllocTestType]& b); ---- == Description Exchange the states of the specified `a` and `b`. Both `a` and `b` will be left in a moved‐into state. No allocations shall occur (so no exceptions will be thrown) unless `a` and `b` have different allocators. == Parameters [cols="1,4"] |=== | Name| Description | *a* | first object to swap | *b* | second object to swap |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#