[#BloombergLP-bslstl-HashTable-06-swap] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]::swap :relfileprefix: ../../../ :mrdocs: Exchange the value of this object, its `comparator` functor, its `hasher` functor, and its `maxLoadFactor` with those of the specified `other` object. Additionally, if `bslstl::AllocatorTraits<ALLOCATOR>::propagate_on_container_swap` is `true`, then exchange the allocator of this object with that of the `other` object, and do not modify either allocator otherwise. This method provides the no‐throw exception‐safety guarantee unless any of the `comparator` or `hasher` functors throw when swapped, leaving both objects in a safely destructible, but otherwise unusable, state. The operation guarantees `O[1]` complexity. The behavior is undefined unless either this object has an allocator that compares equal to the allocator of `other`, or the trait `bslstl::AllocatorTraits<ALLOCATOR>::propagate_on_container_swap` is `true`. == Synopsis Declared in `<bslstl_hashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]& other); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#