首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::future::share

std::shared_future<T> share();

?

?

的共享状态。*this(如有的话)std::shared_future对象。倍数std::shared_future对象可能引用相同的共享状态,而std::future...

打电话后share在...上std::future,,,valid()== false...

参数

%280%29

返回值

std::shared_future对象,该对象包含以前由*this(如有的话),犹如由std::shared_future<T>(std:move(*this))...

例外

noexcept规格:

noexcept

缺陷报告

以下行为更改缺陷报告追溯应用于先前发布的C++标准。

DR

Applied to

Behavior as published

Correct behavior

LWG 2556

C++11

share() requires valid() to be true

requirement removed and made noexcept

另见

shared_future (C++11)

waits for a value (possibly referenced by other futures) that is set asynchronously (class template)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com