[#BloombergLP-bdljsn-swap-085]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::swap
:relfileprefix: ../../
:mrdocs:

Exchange the values of the specified `a` and `b` objects&period;

== Synopsis

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(
    xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]& a,
    xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]& b);
----

== Description

Exchange the value of the specified `a` `JsonObject` with that of the specified `b` `JsonObject`&period; This function provides the no&hyphen;throw exception&hyphen;safety guarantee&period; This operation has O&lsqb;1&rsqb;complexity if `a` was created with the same allocator as `b`&semi; otherwise, it has O&lsqb;n&plus;m&rsqb; complexity, where n and m are the number of elements in `a` and `b`, respectively&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| first object
| *b*
| second object
|===


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