[#BloombergLP-bslstl-swap-010] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::swap :relfileprefix: ../../ :mrdocs: `swap` overloads == Synopses Declared in `<bslstl_bidirectionalnodepool.h>` Swap the functor wrapped by the specified `lhs` object with the functor wrapped by the specified `rhs` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNCTOR> void xref:BloombergLP/bslstl/swap-044.adoc[swap]( xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e.adoc[HashTable_ComparatorWrapper<FUNCTOR>]& lhs, xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e.adoc[HashTable_ComparatorWrapper<FUNCTOR>]& rhs); ---- [.small]#xref:BloombergLP/bslstl/swap-044.adoc[_» more..._]# Swap the functor wrapped by the specified `a` object with the functor wrapped by the specified `b` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNCTOR> void xref:BloombergLP/bslstl/swap-040.adoc[swap]( xref:BloombergLP/bslstl/HashTable_HashWrapper-03.adoc[HashTable_HashWrapper<FUNCTOR>]& a, xref:BloombergLP/bslstl/HashTable_HashWrapper-03.adoc[HashTable_HashWrapper<FUNCTOR>]& b); ---- [.small]#xref:BloombergLP/bslstl/swap-040.adoc[_» more..._]# Efficiently exchange the nodes of the specified `a` object with those of the specified `b` object. This method provides the no‐throw exception‐safety guarantee. The behavior is undefined unless `a.allocator() == b.allocator()`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class ALLOCATOR> void xref:BloombergLP/bslstl/swap-0ee.adoc[swap]( xref:BloombergLP/bslstl/BidirectionalNodePool.adoc[BidirectionalNodePool<VALUE, ALLOCATOR>]& a, xref:BloombergLP/bslstl/BidirectionalNodePool.adoc[BidirectionalNodePool<VALUE, ALLOCATOR>]& b); ---- [.small]#xref:BloombergLP/bslstl/swap-0ee.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This function provides the no‐throw exception‐safety guarantee. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR> void xref:BloombergLP/bslstl/swap-0a.adoc[swap]( xref:BloombergLP/bslstl/SetComparator.adoc[SetComparator<KEY, COMPARATOR>]& a, xref:BloombergLP/bslstl/SetComparator.adoc[SetComparator<KEY, COMPARATOR>]& b); ---- [.small]#xref:BloombergLP/bslstl/swap-0a.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This function provides the no‐throw exception‐safety guarantee. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class COMPARATOR> void xref:BloombergLP/bslstl/swap-015.adoc[swap]( xref:BloombergLP/bslstl/MapComparator-0d.adoc[MapComparator<KEY, VALUE, COMPARATOR>]& a, xref:BloombergLP/bslstl/MapComparator-0d.adoc[MapComparator<KEY, VALUE, COMPARATOR>]& b); ---- [.small]#xref:BloombergLP/bslstl/swap-015.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY_CONFIG, class HASHER, class COMPARATOR, class ALLOCATOR> void xref:BloombergLP/bslstl/swap-0e8.adoc[swap]( xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>]& x, xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>]& y); ---- [.small]#xref:BloombergLP/bslstl/swap-0e8.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#