Namespaces
Variants

std::copyable_function::operator bool

来自 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*)
 
 
explicit operator bool() const noexcept;
(自 C++26 起)

检查 *this是否存储了可调用目标,即非空。

参数

(无)

返回值

若 * this 存储了可调用目标则为 true ,否则为 false 。

示例

参见

(C++26)
比较 std::copyable_function 与 nullptr
(函数)
检查是否包含目标
( std::function<R(Args...)> 的公开成员函数)
检查 std::move_only_function 是否包含目标
( std::move_only_function 的公开成员函数)