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

履歴 編集

class
<execution>

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

namespace std::execution {
  class task_scheduler;
}

概要

task_schedulerは、任意のScheduler型を型消去して保持するSchedulerである。

実行制御ライブラリのタスクコルーチン戻り値task<T, E>において、環境EのデフォルトScheduler型として利用される。

task_schedulerschedulerのモデルである。

クラス仕様

task_schedulerクラスは、下記の説明専用メンバ変数を持つ。

task_scheduler型のオブジェクトsに対して、SCHED(s)s.sch_が所有するポインタが指すオブジェクトとする。

メンバ関数

名前 説明 対応バージョン
(constructor) コンストラクタ C++26
(destructor) デストラクタ C++26
operator= 代入演算子 C++26
schedule スケジュールSenderを返す C++26

メンバ型

名前 説明 対応バージョン
scheduler_concept scheduler_t C++26

比較演算子

名前 説明 対応バージョン
operator== 等値比較 C++26
operator!= 非等値比較 (==により使用可能) C++26

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

int main()
{
  ex::task_scheduler sch1{ ex::get_parallel_scheduler() };
  ex::task_scheduler sch2{ ex::inline_scheduler{} };
  assert(sch1 != sch2);
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照