[#BloombergLP-bdlb-Variant_SwapVisitor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::Variant&lowbar;SwapVisitor
:relfileprefix: ../../
:mrdocs:

This visitor swaps the variant object data that it holds with another variant object data of parameterize `TYPE`&period; It requires that the two variant objects being swapped contain data of the same type, and use the same allocator&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;variant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Variant&lowbar;SwapVisitor;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/Variant_SwapVisitor/2constructor.adoc[`Variant&lowbar;SwapVisitor`]         [.small]#[constructor]#
| Create a swap visitor targeting the specified peer `buffer`&period;
| xref:BloombergLP/bdlb/Variant_SwapVisitor/operator_call.adoc[`operator()`] 
| Swap the value of template parameter `TYPE` with the peer buffer supplied at construction&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/Variant_SwapVisitor/d_buffer_p.adoc[`d&lowbar;buffer&lowbar;p`] 
| Peer buffer used for swapping&period;
|===



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