std::swap(std::list) (3) - Linux Man Pages

std::swap(std::list): std::swap(std::list)

NAME

std::swap(std::list) - std::swap(std::list)

Synopsis


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


Specializes the std::swap algorithm for std::list. 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)