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

履歴 編集

variable
<execution>

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

namespace std::execution {
  template<class Sndr, class Env = env<>>
    requires sender_in<Sndr, Env>
  constexpr bool sends_stopped =
    !same_as<type-list<>,
             gather-signatures<set_stopped_t, completion_signatures_of_t<Sndr, Env>,
                               type-list, type-list>>;
}

概要

Sender型Sndr環境Envにおいて非同期操作を作成できるとき、完了シグネチャ集合停止完了シグネチャを含むか否かを返す。

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

int main()
{
  // 停止完了シグネチャを持たないSender
  ex::sender auto snd1 = ex::just(123, 'X');
  static_assert(not ex::sends_stopped<decltype(snd1)>);

  // 停止完了シグネチャ set_stopped_t()
  ex::sender auto snd2 = ex::just_stopped();
  static_assert(ex::sends_stopped<decltype(snd2)>);
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照