Swap both the value, the hasher, the comparator, and the maxLoadFactor of the specified x object with the value, the hasher, the comparator, and the maxLoadFactor of the specified y object. Additionally, if bslstl::AllocatorTraits<ALLOCATOR>::propagate_on_container_swap is true, then exchange the allocator of x with that of y, and do not modify either allocator otherwise. This method guarantees O[1] complexity if x and y have the same allocator or if the allocators propagate on swap, otherwise this operation will typically pay the cost of two copy constructors, which may in turn throw. If the allocators are the same or propagate, then this method provides the no-throw exception-safety guarantee unless the swap function of the hasher or comparator throw. Otherwise this method offers only the basic exception safety guarantee.
Declared in <bslstl_hashtable.h>
template<
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
void
swap(
HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& x,
HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& y);