最終更新日時(UTC):
が更新

履歴 編集

customization point object
<execution>

std::execution::stop-when(C++26)

namespace std::execution {
  inline constexpr unspecified stop-when{};
}

概要

stop-whenは、入力Senderに追加の停止トークンを結合したSenderを返す、説明専用のSenderアダプタである。

説明用の式sndrtokenに対して、

  • decltype((sndr))senderを満たさない、もしくはremove_cvref_t<decltype((token))>stoppable_tokenを満たさないとき、式stop-when(sndr, token)不適格となる。
  • そうでなく、remove_cvref_t<decltype((token))>unstoppable_tokenのモデルであるとき、式stop-when(sndr, token)は、tokensndrが不定順で順序付けられることを除いて、(void)token, sndrと等価となる。
  • そうでないとき、式stop-when(sndr, token)はSenderosndrを返す。osndrReceiverr接続(connect)されるとき、get_stop_token(get_env(r))の結果をrtokenとする。
    • rtokenの型がunstoppable_tokenのモデルであるとき、osdnrrとの接続の効果はconnect(write_env(sndr, prop(get_stop_token, token)), r)に等しい。
    • そうでないとき、下記のような説明専用の型stoken-tstokenオブジェクトに対して、osdnrrとの接続の効果はconnect(write_env(sndr, prop(get_stop_token, stoken)), r)に等しい。
      • stoken-tstoppable_tokenのモデルである。
      • stoken.stop_requested()token.stop_requested() || rtoken.stop_requested()を返す。
      • stoken.stop_possible()token.stop_possible() || rtoken.stop_possible()を返す。
      • 説明用の型FnInitinvocable<Fn>およびconstructible_from<Fn, Init>のモデルであるとき、stoken-t::callback_type<Fn>stoppable-callback-forのモデルである。

バージョン

言語

  • C++26

関連項目

参照