namespace std::execution {
inline constexpr unspecified stop-when{};
}
概要
stop-whenは、入力Senderに追加の停止トークンを結合したSenderを返す、説明専用のSenderアダプタである。
説明用の式sndrとtokenに対して、
decltype((sndr))がsenderを満たさない、もしくはremove_cvref_t<decltype((token))>がstoppable_tokenを満たさないとき、式stop-token(sndr, token)は不適格となる。- そうでなく、
remove_cvref_t<decltype((token))>がunstoppable_tokenのモデルであるとき、式stop-token(sndr, token)はsndrと等価となる。 - そうでないとき、式
stop-token(sndr, token)はSenderosndrを返す。osndrがReceiverrと接続(connect)されるとき、get_stop_token(get_env(r))の結果をrtokenとする。rtokenの型がunstoppable_tokenのモデルであるとき、osdnrとrとの接続の効果はconnect(write_env(sndr, prop(get_stop_token, token)), r)に等しい。- そうでないとき、下記のような説明専用の型
stoken-tのstokenオブジェクトに対して、osdnrとrとの接続の効果はconnect(write_env(sndr, prop(get_stop_token, stoken)), r)に等しい。stoken-tはstoppable_tokenのモデルである。stoken.stop_requested()はtoken.stop_requested() || rtoken.stop_requested()を返す。stoken.stop_possible()はtoken.stop_possible() || rtoken.stop_possible()を返す。- 説明用の型
FnとInitがinvocable<Fn>およびconstructible_from<Fn, Init>のモデルであるとき、stoken-t::callback_type<Fn>はstoppable-callback-forのモデルである。
バージョン
言語
- C++26