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>

template<
    class KEY,
    class HASH,
    class EQUAL,
    class ALLOCATOR>
void
swap(
    unordered_set<KEY, HASH, EQUAL, ALLOCATOR>& a,
    unordered_set<KEY, HASH, EQUAL, ALLOCATOR>& b) noexcept(noexcept(a.swap(b)));

Created with MrDocs