|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
可调用函数系列函数的实现 更多...
类 | |
| struct | invoke_result< Sign > |
| 推导函数调用结果类型的主模板 更多... | |
| struct | invoke_result< F(Args...)> |
| invoke_result的特化版本 更多... | |
| struct | is_invocable< F, Args > |
| 判断类型是否可调用 更多... | |
| struct | is_invocable_r< Ret, F, Args > |
| 判断类型是否可调用并返回指定类型 更多... | |
| struct | is_nothrow_invocable< F, Args > |
| 判断调用是否不会抛出异常 更多... | |
类型定义 | |
| template<typename F, typename... Args> | |
| using | invoke_result_t = typename inner::__invoke_result_aux<F, Args...>::type |
| invoke_result的便捷别名 | |
函数 | |
| template<typename Callable, typename... Args> | |
| NEFORCE_CONSTEXPR14 inner::__invoke_result_aux< Callable, Args... >::type | invoke (Callable &&f, Args &&... args) noexcept(is_nothrow_invocable< Callable, Args... >::value) |
| 统一调用接口 | |
| template<typename Res, typename Callable, typename... Args> | |
| NEFORCE_CONSTEXPR14 enable_if_t< is_invocable_r< Res, Callable, Args... >::value, Res > | invoke_r (Callable &&f, Args &&... args) noexcept(is_nothrow_invocable< Callable, Args... >::value) |
| 带返回类型检查的统一调用接口 | |
变量 | |
| template<typename F, typename... Args> | |
| NEFORCE_INLINE17 constexpr bool | is_invocable_v = is_invocable<F, Args...>::value |
| is_invocable的便捷变量模板 | |
| template<typename Ret, typename F, typename... Args> | |
| NEFORCE_INLINE17 constexpr bool | is_invocable_r_v = is_invocable_r<Ret, F, Args...>::value |
| is_invocable_r的便捷变量模板 | |
| template<typename F, typename... Args> | |
| NEFORCE_INLINE17 constexpr bool | is_nothrow_invocable_v = is_nothrow_invocable<F, Args...>::value |
| is_nothrow_invocable的便捷变量模板 | |
可调用函数系列函数的实现
| using invoke_result_t = typename inner::__invoke_result_aux<F, Args...>::type |
|
noexcept |
统一调用接口
| Callable | 可调用对象类型 |
| Args | 参数类型 |
| f | 可调用对象 |
| args | 调用参数 |
统一调用接口,支持以下所有调用形式:
在文件 invoke.hpp 第 538 行定义.
引用了 forward().
被这些函数引用 once_flag::call_once , 以及 reference_wrapper< T >::operator()().
|
noexcept |
带返回类型检查的统一调用接口
| Res | 期望的返回类型 |
| Callable | 可调用对象类型 |
| Args | 参数类型 |
| f | 可调用对象 |
| args | 调用参数 |
与invoke类似,但额外检查返回类型是否可以转换为Res。
在文件 invoke.hpp 第 579 行定义.
引用了 forward().