Namespaces
Variants

std::function_ref:: operator()

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* )
R operator ( ) ( Args... args ) const noexcept ( /*noex*/ ) ;
(自 C++26 起)

使用 bound-entity 作为第一个参数以及其余参数 args 调用存储的 thunk-ptr operator ( ) /*noex*/ 部分与 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> 的公开成员函数)