Namespaces
Variants

swap(std::copyable_function)

来自 zh.cppreference.net
 
 
 
函数对象
函数调用
(C++17)(C++23)
恒等函数对象
(C++20)
透明运算符包装器
(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)

旧的绑定器和适配器
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)
(直到 C++17*)  
(直到 C++17*)
(直到 C++17*)(直到 C++17*)(直到 C++17*)(直到 C++17*)
(直到 C++20*)
(直到 C++20*)
(直到 C++17*)(直到 C++17*)
(直到 C++17*)(直到 C++17*)

(直到 C++17*)
(直到 C++17*)(直到 C++17*)(直到 C++17*)(直到 C++17*)
(直到 C++20*)
(直到 C++20*)
 
 
friend void swap( std::copyable_function& lhs, std::copyable_function& rhs ) noexcept;
(自 C++26)

重载了 std::swap 算法,用于 std::copyable_function。交换 lhs 与 rhs 的状态。效果上等同于调用 lhs.swap(rhs)。

此函数在通常的非限定或限定查找中不可见,只能通过实参依赖查找在 std::copyable_function<FunctionType> 是实参的关联类时找到。

参数

lhs, rhs - 要交换状态的 std::copyable_function 对象

返回值

(无)

示例

参见

交换两个 std::copyable_function 对象的目标
(公开成员函数)
特化 std::swap 算法
(函数模板)
特化 std::swap 算法
(函数)