std::future::share
STD::未来:份额
std::shared_future | | |
---|
的共享状态。*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) |
---|
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。