[#BloombergLP-bdljsn-swap-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::swap :relfileprefix: ../../ :mrdocs: Exchange the value of the specified `a` `Json` object with that of the specified `b` `Json` object. If an exception is thrown, both objects are left in valid but unspecified states. This operation guarantees O[1] complexity. The behavior is undefined unless `a` was created with the same allocator as `b`. == Synopsis Declared in `<bdljsn_json.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap( xref:BloombergLP/bdljsn/Json.adoc[Json]& a, xref:BloombergLP/bdljsn/Json.adoc[Json]& b); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#