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

履歴 編集

customization point object
<execution>

std::execution::just_stopped(C++26)

namespace std::execution {
  struct just_stopped_t { unspecified };
  inline constexpr just_stopped_t just_stopped{};
}

概要

just_stoppedは、非同期操作開始(start)停止完了関数を呼び出すSenderファクトリである。

効果

呼び出し式just_stopped()は下記と等価。

make-sender(just_stopped, product-type{})

Senderアルゴリズムタグ just_stopped

Senderアルゴリズム動作説明用のクラステンプレートimpls-forに対して、下記の特殊化が定義される。

namespace std::execution {
  template<>
  struct impls-for<decayed-typeof<just_stopped>> : default-impls {
    static constexpr auto start =
      [](auto& state, auto& rcvr) noexcept -> void {
        /*auto& [...ts] = state;*/
        set_stopped(std::move(rcvr));
      };
  };
}

カスタマイゼーションポイント

Receiverとの接続(connect)時に、関連付けられた実行ドメインに対してexecution::transform_sender経由でSender変換が行われる。 デフォルト実行ドメインでは無変換。

#include <execution>
namespace ex = std::execution;

int main()
{
  // 停止を送信するSender
  ex::sender auto sndr = ex::just_stopped();
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照