「cpp/thread/stop token/stop requested」の版間の差分
提供: cppreference.com
< cpp | thread | stop token
(ページの作成:「{{cpp/thread/stop_token/title|stop_requested}} {{cpp/thread/stop_token/navbar}} {{ddcl | since=c++20 | bool stop_requested() const noexcept; }} {{tt|stop_token}} が紐...」) |
|||
2行: | 2行: | ||
{{cpp/thread/stop_token/navbar}} | {{cpp/thread/stop_token/navbar}} | ||
{{ddcl | since=c++20 | | {{ddcl | since=c++20 | | ||
− | bool stop_requested() const noexcept; | + | bool stop_requested() const noexcept; |
}} | }} | ||
14行: | 14行: | ||
===例=== | ===例=== | ||
− | {{ | + | {{}} |
{{langlinks|en|zh}} | {{langlinks|en|zh}} |
2020年4月1日 (水) 02:55時点における最新版
[[nodiscard]] bool stop_requested() const noexcept; |
(C++20以上) | |
stop_token
が紐付く停止状態を持ち、その状態が停止要求を受け取ったかどうかを調べます。 デフォルト構築された stop_token は紐付く停止状態を持たず、そのため停止要求されることはありません。
[編集] 引数
(なし)
[編集] 戻り値
stop_token
オブジェクトが紐付く停止状態を持ち、その停止状態が停止要求を受け取った場合は true、そうでなければ false。
[編集] 例
This section is incomplete Reason: no example |