std::swap(std::function)

From cppreference.com
< cpplrm; | utilitylrm; | functionallrm; | function
Function objects
Function wrappers
(C++11)
(C++11)
Bind
(C++11)
Function invocation
(C++17)
Identity function object
(C++20)
Reference wrappers
(C++11)(C++11)
Operator wrappers
Negators
(C++17)
Searchers
Old binders and adaptors
(until C++17)
(until C++17)
(until C++17)
(until C++17)
(until C++17)(until C++17)(until C++17)(until C++17)
(until C++20)
(until C++20)
(until C++17)(until C++17)
(until C++17)(until C++17)

(until C++17)
(until C++17)(until C++17)(until C++17)(until C++17)
(until C++20)
(until C++20)
template< class R, class... Args >
void swap( function<R(Args...)> &lhs, function<R(Args...)> &rhs );

Overloads the std::swap algorithm for std::function. Exchanges the state of lhs with that of rhs. Effectively calls lhs.swap(rhs).

Parameters

lhs, rhs - polymorphic function wrappers whose states to swap

Return value

(none)

Exceptions

(none) (until C++17)
noexcept specification:
noexcept
(since C++17)

Example

See also

swaps the contents
(public member function)