Namespaces
Variants
Views
Actions

swap(std::copyable_function)

From cppreference.com
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Function objects
Function invocation
(C++17)(C++23)
Identity function object
(C++20)
Transparent operator wrappers
(C++14)
(C++14)
(C++14)
(C++14)  
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)
(C++14)

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++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*)
 
 
friend void swap( std::copyable_function& lhs, std::copyable_function& rhs ) noexcept;
(since C++26)

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

This function is not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::copyable_function<FunctionType> is an associated class of the arguments.

Contents

Parameters

lhs, rhs - std::copyable_function objects whose states to swap

Return value

(none)

Example

See also

swaps the targets of two std::copyable_function objects
(public member function) [edit]
specializes the std::swap algorithm
(function template) [edit]
specializes the std::swap algorithm
(function) [edit]