[#bsl-swap-0dc] = xref:bsl.adoc[bsl]::swap :relfileprefix: ../ :mrdocs: `swap` overloads == Synopses Declared in `<bslstl_deque.h>` Set `lhs` to refer to the stop state (or lack thereof) that `rhs` referred to before the call, and vice versa. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stopsource.general]). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/swap-03fc.adoc[swap]( xref:bsl/stop_source.adoc[stop_source]& lhs, xref:bsl/stop_source.adoc[stop_source]& rhs) noexcept; ---- [.small]#xref:bsl/swap-03fc.adoc[_» more..._]# Set `lhs` to refer to the stop state (or lack thereof) that `rhs` referred to, and vice versa. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/swap-06da.adoc[swap]( xref:bsl/stop_token.adoc[stop_token]& lhs, xref:bsl/stop_token.adoc[stop_token]& rhs) noexcept; ---- [.small]#xref:bsl/swap-06da.adoc[_» more..._]# Exchange the values of the specified `a` and `b` objects. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/swap-05ca.adoc[swap]( xref:bsl/vector-086.adoc[vector]& a, xref:bsl/vector-086.adoc[vector]& b) noexcept(noexcept(a.d_impl.swap(b.d_impl))); ---- [.small]#xref:bsl/swap-05ca.adoc[_» more..._]# Exchange the values of the specified `a` and `b` objects. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/swap-080.adoc[swap]( xref:bsl/vector-00d.adoc[vector<void*>]& a, xref:bsl/vector-00d.adoc[vector<void*>]& b) noexcept(noexcept(a.d_impl.swap(b.d_impl))); ---- [.small]#xref:bsl/swap-080.adoc[_» more..._]# Exchange the values of the specified `a` and `b` objects. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void xref:bsl/swap-018.adoc[swap]( xref:bsl/vector-00d.adoc[vector<char const*>]& a, xref:bsl/vector-00d.adoc[vector<char const*>]& b) noexcept(noexcept(a.d_impl.swap(b.d_impl))); ---- [.small]#xref:bsl/swap-018.adoc[_» more..._]# Exchange the targets held by the specified `a` and specified `b` objects. The behavior is undefined unless 'a.get_allocator() == b.get_allocator()'. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PROTOTYPE> void xref:bsl/swap-026.adoc[swap]( xref:bsl/function-0a.adoc[function<PROTOTYPE>]& a, xref:bsl/function-0a.adoc[function<PROTOTYPE>]& b) noexcept; ---- [.small]#xref:bsl/swap-026.adoc[_» more..._]# Efficiently exchange the values of the specified `lhs` and `rhs` objects. This method provides the no‐throw exception‐safety guarantee if the template parameter `t_TYPE` provides that guarantee, `lhs` and `rhs` have equal allocators, and `lhs.hasValue() == rhs.hasValue()`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> void xref:bsl/swap-04d.adoc[swap]( xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& lhs, xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& rhs) requires BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value; ---- [.small]#xref:bsl/swap-04d.adoc[_» more..._]# Efficiently exchange the values of the specified `lhs` and `rhs` objects. This method provides the no‐throw exception‐safety guarantee if the template parameter `t_TYPE` provides that guarantee and the result of the `hasValue` method for `lhs` and `rhs` is the same. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> constexpr void xref:bsl/swap-0f3.adoc[swap]( xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& lhs, xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& rhs) requires !BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value; ---- [.small]#xref:bsl/swap-0f3.adoc[_» more..._]# Efficiently exchange the values of the specified `lhs` and `rhs` objects. This method provides the no‐throw exception‐safety guarantee if the template parameter `t_TYPE` provides that guarantee and the result of the `hasValue` method for `lhs` and `rhs` is the same. This function can be called in constant expressions only if `t_TYPE` is not allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> void xref:bsl/swap-00c.adoc[swap]( xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& lhs, std::optional<t_TYPE>& rhs) requires !BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value; ---- [.small]#xref:bsl/swap-00c.adoc[_» more..._]# Exchange the values of the specified `lhs` and `rhs` optional objects. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_TYPE> constexpr void xref:bsl/swap-089.adoc[swap]( std::optional<t_TYPE>& lhs, xref:bsl/optional-072.adoc[bsl::optional<t_TYPE>]& rhs) requires !BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value; ---- [.small]#xref:bsl/swap-089.adoc[_» more..._]# Efficiently exchange the states of the specified `a` and `b` shared pointers such that each will refer to the object formerly referred to by the other, and each will manage the object formerly managed by the other. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ELEMENT_TYPE> void xref:bsl/swap-092.adoc[swap]( xref:bsl/shared_ptr-0a.adoc[shared_ptr<ELEMENT_TYPE>]& a, xref:bsl/shared_ptr-0a.adoc[shared_ptr<ELEMENT_TYPE>]& b) noexcept; ---- [.small]#xref:bsl/swap-092.adoc[_» more..._]# Efficiently exchange the states of the specified `a` and `b` weak pointers such that each will refer to the object (if any) and representation formerly referred to by the other. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ELEMENT_TYPE> void xref:bsl/swap-0447.adoc[swap]( xref:bsl/weak_ptr-0d.adoc[weak_ptr<ELEMENT_TYPE>]& a, xref:bsl/weak_ptr-0d.adoc[weak_ptr<ELEMENT_TYPE>]& b) noexcept; ---- [.small]#xref:bsl/swap-0447.adoc[_» more..._]# Exchange the value of the specified `a` object with that 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. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, class ALLOCATOR> void xref:bsl/swap-096.adoc[swap]( xref:bsl/deque-0c.adoc[deque<VALUE_TYPE, ALLOCATOR>]& a, xref:bsl/deque-0c.adoc[deque<VALUE_TYPE, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-096.adoc[_» more..._]# Exchange the value of the specified `a` object with that 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. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class ALLOCATOR> void xref:bsl/swap-06d9.adoc[swap]( xref:bsl/list-054.adoc[list<VALUE, ALLOCATOR>]& a, xref:bsl/list-054.adoc[list<VALUE, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-06d9.adoc[_» more..._]# Swap the values of the specified `a` and `b` pairs by applying `swap` to each of the `first` and `second` pair fields. Note that this method is no‐throw only if `swap` on each field is no‐throw. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class T1, class T2> void xref:bsl/swap-0ce.adoc[swap]( xref:bsl/pair-0b.adoc[pair<T1, T2>]& a, xref:bsl/pair-0b.adoc[pair<T1, T2>]& b) noexcept(noexcept(a.swap(b))) requires bsl::is_swappable<T1>::value && bsl::is_swappable<T2>::value; ---- [.small]#xref:bsl/swap-0ce.adoc[_» more..._]# Swap the value of the specified `lhs` queue with the value of the specified `rhs` queue. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class CONTAINER> void xref:bsl/swap-020.adoc[swap]( xref:bsl/queue-0a5.adoc[queue<VALUE, CONTAINER>]& lhs, xref:bsl/queue-0a5.adoc[queue<VALUE, CONTAINER>]& rhs) noexcept(false); ---- [.small]#xref:bsl/swap-020.adoc[_» more..._]# Swap the value of the specified `lhs` stack with the value of the specified `rhs` stack. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class CONTAINER> void xref:bsl/swap-0cb.adoc[swap]( xref:bsl/stack-05.adoc[stack<VALUE, CONTAINER>]& lhs, xref:bsl/stack-05.adoc[stack<VALUE, CONTAINER>]& rhs) noexcept(false); ---- [.small]#xref:bsl/swap-0cb.adoc[_» more..._]# Efficiently exchange the values of the specified `lhs` and `rhs` objects. This method provides the no‐throw guarantee if the two variant objects being swapped have the same active alternative and that alternative provides that guarantee; otherwise, this method provides the basic guarantee. If `lhs` and `rhs` do not contain the same alternative or they have unequal allocators, and an exception is thrown during the swap, either or both variant objects may be left in a valueless state or with an alternative in a moved‐from state. All alternatives shall be move constructible and swappable. For simplicity of implementation, this function differs from the standard in the following : * constraints are not implemented * constexpr is not implemented [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_HEAD, class... t_TAIL> void xref:bsl/swap-0f5.adoc[swap]( xref:bsl/variant.adoc[bsl::variant<t_HEAD, t_TAIL...>]& lhs, xref:bsl/variant.adoc[bsl::variant<t_HEAD, t_TAIL...>]& rhs); ---- [.small]#xref:bsl/swap-0f5.adoc[_» more..._]# Exchange the value of the specified `a` object with that 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. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE_TYPE, class ALLOCATOR> void xref:bsl/swap-0a1.adoc[swap]( xref:bsl/vector-00d.adoc[vector<VALUE_TYPE, ALLOCATOR>]& a, xref:bsl/vector-00d.adoc[vector<VALUE_TYPE, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-0a1.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This method provides the no‐throw exception‐safety guarantee if `a` and `b` allocators compare equal. Note that this function is only available for C++11 (and later) language standards. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> void xref:bsl/swap-0d4.adoc[swap]( xref:bsl/basic_istringstream.adoc[basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& a, xref:bsl/basic_istringstream.adoc[basic_istringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& b); ---- [.small]#xref:bsl/swap-0d4.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This method provides the no‐throw exception‐safety guarantee if `a` and `b` allocators compare equal. Note that this function is only available for C++11 (and later) language standards. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> void xref:bsl/swap-06e.adoc[swap]( xref:bsl/basic_ostringstream.adoc[basic_ostringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& a, xref:bsl/basic_ostringstream.adoc[basic_ostringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& b); ---- [.small]#xref:bsl/swap-06e.adoc[_» more..._]# Exchange the value of the specified `a` object with that 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. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the lengths of `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> void xref:bsl/swap-0eb7.adoc[swap]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& a, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-0eb7.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This method provides the no‐throw exception‐safety guarantee if `a` and `b` allocators compare equal. Note that this function is only available for C++11 (and later) language standards. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> void xref:bsl/swap-06f.adoc[swap]( xref:bsl/basic_stringbuf.adoc[basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& a, xref:bsl/basic_stringbuf.adoc[basic_stringbuf<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& b); ---- [.small]#xref:bsl/swap-06f.adoc[_» more..._]# Efficiently exchange the values of the specified `a` and `b` objects. This method provides the no‐throw exception‐safety guarantee if `a` and `b` allocators compare equal. Note that this function is only available for C++11 (and later) language standards. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> void xref:bsl/swap-0b1.adoc[swap]( xref:bsl/basic_stringstream.adoc[basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& a, xref:bsl/basic_stringstream.adoc[basic_stringstream<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]& b); ---- [.small]#xref:bsl/swap-0b1.adoc[_» more..._]# Swap the specified `a` with the specified `b` using `a.swap(b)` expression. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR, class TRAITS, class ALLOCATOR> void xref:bsl/swap-0a4.adoc[swap]( xref:bsl/basic_syncbuf.adoc[basic_syncbuf<CHAR, TRAITS, ALLOCATOR>]& a, xref:bsl/basic_syncbuf.adoc[basic_syncbuf<CHAR, TRAITS, ALLOCATOR>]& b); ---- [.small]#xref:bsl/swap-0a4.adoc[_» more..._]# Exchange the values of the specified `a` and `b` multisets. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR, class ALLOCATOR> void xref:bsl/swap-001.adoc[swap]( xref:bsl/multiset-03.adoc[multiset<KEY, COMPARATOR, ALLOCATOR>]& a, xref:bsl/multiset-03.adoc[multiset<KEY, COMPARATOR, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-001.adoc[_» more..._]# Exchange the container and comparator of the specified `a` object with the container and comparator of the specified `b` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VALUE, class CONTAINER, class COMPARATOR> void xref:bsl/swap-07d.adoc[swap]( xref:bsl/priority_queue-034.adoc[priority_queue<VALUE, CONTAINER, COMPARATOR>]& a, xref:bsl/priority_queue-034.adoc[priority_queue<VALUE, CONTAINER, COMPARATOR>]& b) noexcept(false); ---- [.small]#xref:bsl/swap-07d.adoc[_» more..._]# Exchange the value and comparator 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 the (template parameter) type `COMPARATOR` provides a no‐throw swap operation, and provides the basic exception‐safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class COMPARATOR, class ALLOCATOR> void xref:bsl/swap-0c8.adoc[swap]( xref:bsl/set-0d.adoc[set<KEY, COMPARATOR, ALLOCATOR>]& a, xref:bsl/set-0d.adoc[set<KEY, COMPARATOR, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-0c8.adoc[_» more..._]# Exchange the contents of the specified hash multisets. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class _Value, class _HashFcn, class _EqualKey, class _Alloc> void xref:bsl/swap-079.adoc[swap]( xref:bsl/hash_multiset.adoc[hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>]& lhs, xref:bsl/hash_multiset.adoc[hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>]& rhs); ---- [.small]#xref:bsl/swap-079.adoc[_» more..._]# Exchange the contents of the specified hash sets. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class _Value, class _HashFcn, class _EqualKey, class _Alloc> void xref:bsl/swap-075.adoc[swap]( xref:bsl/hash_set.adoc[hash_set<_Value, _HashFcn, _EqualKey, _Alloc>]& lhs, xref:bsl/hash_set.adoc[hash_set<_Value, _HashFcn, _EqualKey, _Alloc>]& rhs); ---- [.small]#xref:bsl/swap-075.adoc[_» more..._]# Exchange the value and comparator 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 the (template parameter) type `COMPARATOR` provides a no‐throw swap operation, and provides the basic exception‐safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function's support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class COMPARATOR, class ALLOCATOR> void xref:bsl/swap-0cc.adoc[swap]( xref:bsl/map-0a7.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>]& a, xref:bsl/map-0a7.adoc[map<KEY, VALUE, COMPARATOR, ALLOCATOR>]& b) noexcept(false); ---- [.small]#xref:bsl/swap-0cc.adoc[_» more..._]# Exchange the value and comparator 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 the (template parameter) type `COMPARATOR` provides a no‐throw swap operation, and provides the basic exception‐safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the number of elements in `a` and `b`, respectively. Note that this function's support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class COMPARATOR, class ALLOCATOR> void xref:bsl/swap-073.adoc[swap]( xref:bsl/multimap-0ae.adoc[multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>]& a, xref:bsl/multimap-0ae.adoc[multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>]& b) noexcept(false); ---- [.small]#xref:bsl/swap-073.adoc[_» more..._]# Exchange the values of the specified `a` and `b` objects. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class HASH, class EQUAL, class ALLOCATOR> void xref:bsl/swap-03d7.adoc[swap]( xref:bsl/unordered_multiset-06c.adoc[unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>]& a, xref:bsl/unordered_multiset-06c.adoc[unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-03d7.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class HASH, class EQUAL, class ALLOCATOR> void xref:bsl/swap-05b.adoc[swap]( xref:bsl/unordered_set-0d2d.adoc[unordered_set<KEY, HASH, EQUAL, ALLOCATOR>]& a, xref:bsl/unordered_set-0d2d.adoc[unordered_set<KEY, HASH, EQUAL, ALLOCATOR>]& b) noexcept(noexcept(a.swap(b))); ---- [.small]#xref:bsl/swap-05b.adoc[_» more..._]# Exchange the contents of the specified hash maps. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc> void xref:bsl/swap-030.adoc[swap]( xref:bsl/hash_map.adoc[hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>]& lhs, xref:bsl/hash_map.adoc[hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>]& rhs); ---- [.small]#xref:bsl/swap-030.adoc[_» more..._]# Exchange the contents of the specified hash multimaps. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc> void xref:bsl/swap-046.adoc[swap]( xref:bsl/hash_multimap.adoc[hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>]& lhs, xref:bsl/hash_multimap.adoc[hash_multimap<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>]& rhs); ---- [.small]#xref:bsl/swap-046.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR> void xref:bsl/swap-04c.adoc[swap]( xref:bsl/unordered_map-02b.adoc[unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& a, xref:bsl/unordered_map-02b.adoc[unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& b) noexcept(false); ---- [.small]#xref:bsl/swap-04c.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR> void xref:bsl/swap-08c.adoc[swap]( xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& a, xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>]& b) noexcept(false); ---- [.small]#xref:bsl/swap-08c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#