|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
通用函数包装器类模板 更多...
#include <function.hpp>
Public 类型 | |
| using | result_type = Res |
| 返回类型别名 | |
Public 成员函数 | |
| function (nullptr_t null=nullptr) noexcept | |
| 默认构造函数 | |
| function (const function &x) | |
| 复制构造函数 | |
| function (function &&x) noexcept | |
| 移动构造函数 | |
| template<typename F, enable_if_t< callable_t< F >::value, int > = 0> | |
| function (F &&f) noexcept(handler_t< F >::template nothrow_init< F >()) | |
| 从任意可调用对象构造 | |
| function & | operator= (const function &x) |
| 复制赋值运算符 | |
| function & | operator= (function &&x) noexcept |
| 移动赋值运算符 | |
| function & | operator= (nullptr_t null) noexcept |
| 空指针赋值运算符 | |
| template<typename F, enable_if_t< callable_t< F >::value, int > = 0> | |
| function & | operator= (F &&f) noexcept(handler_t< F >::template nothrow_init< F >()) |
| 从任意可调用对象赋值 | |
| template<typename F> | |
| function & | operator= (reference_wrapper< F > f) noexcept |
| 从引用包装器赋值 | |
| void | swap (function &x) noexcept |
| 交换两个function对象 | |
| operator bool () const noexcept | |
| 转换为布尔值 | |
| Res | operator() (Args &&... args) const noexcept(noexcept(invoker_(func_, _MSTL forward< Args >(args)...))) |
| 函数调用运算符 | |
| MSTL_NODISCARD const std::type_info & | target_type () const noexcept |
| 获取目标类型信息 | |
| template<typename F> | |
| const F * | target () const noexcept |
| 获取目标对象的常量指针 | |
| template<typename F> | |
| F * | target () noexcept |
| 获取目标对象的指针 | |
通用函数包装器类模板
| Res | 返回类型 |
| Args | 参数类型 |
提供类型安全的函数包装,支持存储、复制和调用任意可调用对象。
在文件 function.hpp 第 281 行定义.
|
inlinenoexcept |
默认构造函数
| null | 空指针字面量 |
在文件 function.hpp 第 327 行定义.
被这些函数引用 function(), function(), operator=(), operator=(), operator=(), operator=(), operator=(), swap() , 以及 target().
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
从任意可调用对象赋值
| F | 可调用对象类型 |
| f | 可调用对象 |
在文件 function.hpp 第 418 行定义.
引用了 _MSTL, forward() , 以及 function().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
获取目标对象的指针
| F | 目标类型 |
在文件 function.hpp 第 496 行定义.
引用了 function() , 以及 target().
|
inlinenoexcept |