Namespaces
Variants

swap (std::copyable_function)

From cppreference.net
Utilities library
Function objects
Function invocation
(C++17) (C++23)
Identity function object
(C++20)
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* )
friend void swap ( std:: copyable_function & lhs, std:: copyable_function & rhs ) noexcept ;
(自 C++26 起)

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

此函数对普通的 非限定查找 限定查找 不可见,仅当 std::copyable_function<FunctionType> 作为参数的关联类时,通过 实参依赖查找 才能找到该函数。

目录

参数

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

返回值

(无)

示例

参见

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