在线文档教程
C++
线程支持 | Thread support

std::future::share

STD::未来:份额

std::shared_future 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++标准。

DRApplied toBehavior as publishedCorrect behavior
LWG 2556C++11share() requires valid() to be truerequirement removed and made noexcept

另见

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

© cppreference.com

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

http://en.cppreference.com/w/cpp/线程/前途/共享