CppDS.com

C++ 98 11 14 17 20 手册

std::experimental::shared_future

来自cppreference.com
定义于头文件 <experimental/shared_future>
template< class T > class shared_future;
(1) (并发 TS)
template< class T > class shared_future<T&>;
(2) (并发 TS)
template<>          class shared_future<void>;
(3) (并发 TS)

类模板 std::experimental::shared_future 以下列操作扩展 std::shared_future

  • future<shared_future<T>> 构造的解包装构造函数
  • 查询共享状态是否就绪的成员函数 is_ready ;以及
  • 附着持续到 future 的成员函数 then

std::experimental::shared_futurestd::shared_future 间无交互。

成员函数

构造 shared_future
(公开成员函数)
检查共享状态是否就绪
(公开成员函数)
附着持续到 shared_future
(公开成员函数)
赋值内容
(公开成员函数)


等同于 std::shared_future 的成员

成员函数

destructs the future object
(std::shared_future<T> 的公开成员函数)
获取结果
返回结果
(std::shared_future<T> 的公开成员函数)
状态
检查 future 是否拥有共享状态
(std::shared_future<T> 的公开成员函数)
等待结果变得可用
(std::shared_future<T> 的公开成员函数)
等待结果,如果在指定的超时间隔后仍然无法得到结果,则返回。
(std::shared_future<T> 的公开成员函数)
等待结果,如果在已经到达指定的时间点时仍然无法得到结果,则返回。
(std::shared_future<T> 的公开成员函数)


示例

参阅

(并发 TS)
以持续和其他特性增强的 std::future 版本
(类模板)
关闭