[#bsl-swap-05b] = xref:bsl.adoc[bsl]::swap :relfileprefix: ../ :mrdocs: Exchange the value, hasher, key‐equality functor, and `max_load_factor` of the specified `a` object with those of the specified `b` object; also exchange the allocator of `a` with that of `b` if the (template parameter) type `ALLOCATOR` has the `propagate_on_container_swap` trait, and do not modify either allocator otherwise. This function provides the no‐throw exception‐safety guarantee if and only if both the (template parameter) types `HASH` and `EQUAL` provide no‐throw swap operations; 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 either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait. == Synopsis Declared in `<bslstl_unorderedset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class HASH, class EQUAL, class ALLOCATOR> void swap( xref:bsl/unordered_set-0d2d.adoc[unordered_set<KEY, HASH, EQUAL, ALLOCATOR>]& a, xref:bsl/unordered_set-0d2d.adoc[unordered_set<KEY, HASH, EQUAL, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#