[#bsl-swap-0dc] = xref:bsl.adoc[bsl]::swap :relfileprefix: ../ :mrdocs: `swap` overloads == Synopses Declared in `<bslstl_deque.h>` Exchange the stop states referred to by `lhs` and `rhs`. [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..._]# Exchange the stop states referred to by `lhs` and `rhs`. [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 targets held by the specified `a` and `b` functions. [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..._]# Exchange the values of two optionals. [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..._]# Exchange the values of two optionals. [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..._]# Exchange the values of two optionals. [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..._]# Exchange the states of the specified `shared_ptr` objects `a` and `b`. [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..._]# Exchange the states of the specified `weak_ptr` objects `a` and `b`. [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 values of the specified `a` and `b` deques. [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 values of the specified `a` and `b` lists. [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. [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 values of the specified `lhs` and `rhs` queues. [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. [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 contents of two vectors. [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. [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. [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 contents of two strings. [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. [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. [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 `a` with those of `b`. [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 `a` with those of `b`. [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 `a` with those of `b`. [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 `a` with those of `b`. [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 contents of `a` and `b`. [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 contents of `a` with those of `b`. [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 of `a` with that of `b`. [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..._]# == Parameters [cols="1,4"] |=== | Name| Description | *lhs* | first source participating in the swap | *rhs* | second source participating in the swap | *a* | first vector to swap | *b* | second vector to swap |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#