Namespaces
Variants

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

From cppreference.net
定义于头文件 <experimental/functional>
template < class R, class ... ArgTypes >

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

std:: nullptr_t ) noexcept ;
(1) (库基础技术规范)
template < class R, class ... ArgTypes >

bool operator == ( std:: nullptr_t ,

const std:: experimental :: function < R ( ArgTypes... ) > & f ) noexcept ;
(2) (库基础技术规范)
(在库基础技术规范 v3 中移除)
template < class R, class ... ArgTypes >

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

std:: nullptr_t ) noexcept ;
(3) (库基础技术规范)
(在库基础技术规范 v3 中移除)
template < class R, class ... ArgTypes >

bool operator ! = ( std:: nullptr_t ,

const std:: experimental :: function < R ( ArgTypes... ) > & f ) noexcept ;
(4) (库基础技术规范)
(在库基础技术规范 v3 中移除)

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

!= 运算符由 operator== 合成

(库基础 TS v3)

参数

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

返回值

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

参见

(C++20 中移除)
比较 std::function nullptr
(函数模板)