命名空间
变体
操作

std::function_ref::operator()

出自 cppreference.cn
 
 
 
函数对象
函数调用
(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*)
 
 
R operator()( Args... args ) const noexcept(/*noex*/);
(自 C++26 起)

使用 bound-entity 作为首个参数,以及其余参数 args 调用存储的 thunk-ptr/*noex*/ 部分 operator()std::function_ref 的模板参数的该部分相同。

等价于 return thunk-ptr(bound-entity, std::forward<Args>(args)...);

目录

[编辑] 参数

args - 传递给存储的 thunk-ptr 的剩余参数

[编辑] 返回值

thunk-ptr(bound-entity, std::forward<Args>(args)...).

[编辑] 异常

传递底层函数调用抛出的异常。

[编辑] 示例

[编辑] 参见

调用目标
(std::function<R(Args...)> 的公共成员函数) [编辑]
调用存储的函数
(std::reference_wrapper<T> 的公共成员函数) [编辑]