SysTutorials

Linux Manual Pages › Section 3

stdswapstddeque(3)

std::swap(std::deque) - std::swap(std::deque)

Synopsis

template <class T, class Alloc>
void swap(deque<T, Alloc> &lhs, (until C++ 17)
                                    deque<T, Alloc> &rhs);
template <class T, class Alloc>
void swap(deque<T, Alloc> &lhs, (since C++ 17)
                                    deque<T, Alloc> &rhs) noexcept(/* see below */);

Specializes the std::swap algorithm for std::deque. Swaps the contents of lhs and rhs. Calls lhs.swap(rhs).

Parameters

lhs, rhs - containers whose contents to swap

Return value

(none)

Complexity

Constant.

Exceptions

noexcept specification: (since C++17) noexcept(noexcept(lhs.swap(rhs)))

See also

     swaps the contents swap (public member function)