# std::swap(std::function)

From cppreference.com
< cpp‎ | utility‎ | functional‎ | function

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

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)

### Example

| This section is incomplete Reason: no example

### See also

swap | swaps the contents (public member function)

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/functional/function/swap2&oldid=110158"