命名空间
变体
操作

operator==,!=(std::experimental::function)

来自 cppreference.cn
 
 
实验性
技术规范
文件系统库 (filesystem TS)
库基础 (library fundamentals TS)
库基础 2 (library fundamentals TS v2)
库基础 3 (library fundamentals TS v3)
并行扩展 (parallelism TS)
并行扩展 2 (parallelism TS v2)
并发扩展 (concurrency TS)
并发扩展 2 (concurrency TS v2)
概念 (concepts TS)
范围 (ranges TS)
反射 (reflection TS)
数学特殊函数 (special functions TR)
实验性非TS
模式匹配
线性代数
std::execution
契约
2D图形
 
 
 
定义于头文件 <experimental/functional>
template< class R, class... ArgTypes >

bool operator==( const std::experimental::function<R(ArgTypes...)>& f,

                 std::nullptr_t ) noexcept;
(1) (library fundamentals TS)
template< class R, class... ArgTypes >

bool operator==( std::nullptr_t,

                 const std::experimental::function<R(ArgTypes...)>& f ) noexcept;
(2) (library fundamentals TS)
(removed in library fundamentals TS v3)
template< class R, class... ArgTypes >

bool operator!=( const std::experimental::function<R(ArgTypes...)>& f,

                 std::nullptr_t ) noexcept;
(3) (library fundamentals TS)
(removed in library fundamentals TS v3)
template< class R, class... ArgTypes >

bool operator!=( std::nullptr_t,

                 const std::experimental::function<R(ArgTypes...)>& f ) noexcept;
(4) (library fundamentals TS)
(removed in library fundamentals TS v3)

std::experimental::function 与空指针进行比较。 空函数(即,没有可调用目标的函数)比较相等,非空函数比较不相等。

!= 运算符是从 operator== 合成 的。

(library fundamentals TS v3)

[编辑] 参数

f - 要比较的 std::experimental::function

[编辑] 返回值

1,2) !f
3,4) (bool) f

[编辑] 参见

(在 C++20 中移除)
std::functionnullptr 进行比较
(函数模板) [编辑]