|
MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
MSTL异步结果消费者 更多...
#include "MSTL/core/memory/aligned_buffer.hpp"#include "MSTL/core/memory/weak_ptr.hpp"#include "MSTL/core/memory/allocated_ptr.hpp"#include "MSTL/core/exception/exception_ptr.hpp"#include "MSTL/core/functional/function.hpp"#include "MSTL/core/async/atomic_futex.hpp"#include "MSTL/core/async/call_once.hpp"#include "MSTL/core/async/at_thread_exit.hpp"#include "MSTL/core/utility/none.hpp"类 | |
| class | future< Res > |
| 独占future类模板 更多... | |
| class | future< Res & > |
| 引用类型的future特化 更多... | |
| class | future< void > |
| void类型的future特化 更多... | |
| class | shared_future< Res > |
| 共享future类模板 更多... | |
| class | shared_future< Res & > |
| 引用类型的共享future特化 更多... | |
| class | shared_future< void > |
| void类型的共享future特化 更多... | |
| struct | future_result< T > |
| future结果类型转换 更多... | |
| struct | future_result< void > |
| void类型的future结果转换特化 更多... | |
类型定义 | |
| template<typename Func, typename... Args> | |
| using | async_result_t = invoke_result_t<decay_t<Func>, decay_t<Args>...> |
| 异步调用结果类型推导 | |
| template<typename T> | |
| using | future_result_t = typename future_result<T>::type |
| future结果类型别名 | |
枚举 | |
| enum class | future_errc { future_errc::future_already_retrieved = 1 , future_errc::promise_already_satisfied , future_errc::no_state , future_errc::broken_promise } |
| 期值错误码枚举 更多... | |
| enum class | future_status { future_status::ready , future_status::timeout , future_status::deferred } |
| 期值状态枚举 更多... | |
| enum class | launch { launch::async = 1 , launch::deferred = 2 } |
| 异步启动策略枚举 更多... | |
函数 | |
| template<typename Func, typename... Args> | |
| future< async_result_t< Func, Args... > > | async (launch policy, Func &&function, Args &&... args) |
| 异步执行函数(指定策略) | |
| template<typename Func, typename... Args> | |
| future< async_result_t< Func, Args... > > | async (Func &&function, Args &&... args) |
| 异步执行函数(默认策略) | |
| template<typename T> | |
| MSTL_ALWAYS_INLINE enable_if_t< is_void_v< T >, future_result_t< T > > | get (future< T > &f) |
| 通用future结果获取函数 | |
| template<typename T> | |
| MSTL_ALWAYS_INLINE enable_if_t<!is_void_v< T >, future_result_t< T > > | get (future< T > &f) |
| 通用future结果获取函数 | |
| MSTL_ALWAYS_INLINE enable_if_t<!is_void_v< T >, future_result_t< T > > get | ( | future< T > & | f | ) |
通用future结果获取函数
| T | 非void类型 |
| f | future对象 |
在文件 future.hpp 第 1216 行定义.
引用了 future< Res >::get().