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) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

