Namespaces
Variants

operator== (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 bool operator == ( const std:: copyable_function & f, std:: nullptr_t ) noexcept ;
(自 C++26 起)

检查包装器 f 是否具有可调用目标,通过将其与 std::nullptr_t 进行形式化比较。空包装器(即无目标的包装器)比较结果为相等,非空函数比较结果为不相等。

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

!= 运算符由 operator== 合成 而来。

目录

参数

f - 待比较的 std::copyable_function

返回值

! f .

示例

参见

检查 std::copyable_function 是否拥有目标对象
(公开成员函数)
(C++20 中移除)
比较 std::function nullptr
(函数模板)
(C++23)
比较 std::move_only_function nullptr
(函数)