[#bsl-unordered_set-02a-swap] = xref:bsl.adoc[bsl]::xref:bsl/unordered_set-02a.adoc[unordered_set<ManagedAttribute, AttributeHash>]::swap :relfileprefix: ../../ :mrdocs: Exchange the value, hasher, key‐equality functor, and `max_load_factor` of this object with those of the specified `other` object; also exchange the allocator of this object with that of `other` if the (template parameter) type `ALLOCATOR` has the `propagate_on_container_swap` trait, and do not modify either allocator otherwise. This method 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 this object was created with the same allocator as `other` or `ALLOCATOR` has the `propagate_on_container_swap` trait. == Synopsis Declared in `<bslstl_unorderedset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(xref:bsl/unordered_set-0d2d.adoc[unordered_set<ManagedAttribute, AttributeHash>]& other) noexcept(/* see-below */); ---- == Exception specification This function is potentially-throwing unless `AllocatorTraits::is_always_equal::value && bsl::is_nothrow_swappable<HASH>::value && bsl::is_nothrow_swappable<EQUAL>::value`. [.small]#Created with https://www.mrdocs.com[MrDocs]#