[#BloombergLP-bslma-AllocatorUtil-swap-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::swap
:relfileprefix: ../../../
:mrdocs:

`swap` overloads

== Synopses

Declared in `&lt;bslma&lowbar;allocatorutil&period;h&gt;`

Conditionally swap the values at `pa` and `pb` based on `allowed`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslma/AllocatorUtil/swap-075bea.adoc[swap](
    t&lowbar;TYPE* pa,
    t&lowbar;TYPE* pb,
    xref:bsl/false_type.adoc[bsl::false&lowbar;type] allowed);
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/swap-075bea.adoc[_» more&period;&period;&period;_]#

Conditionally swap the values at `pa` and `pb` when `allowed` is `true&lowbar;type`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslma/AllocatorUtil/swap-075be4.adoc[swap](
    t&lowbar;TYPE* pa,
    t&lowbar;TYPE* pb,
    xref:bsl/true_type.adoc[bsl::true&lowbar;type] allowed);
----

[.small]#xref:BloombergLP/bslma/AllocatorUtil/swap-075be4.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pa*
| address of the first object to swap
| *pb*
| address of the second object to swap
| *allowed*
| whether swapping is permitted
|===


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