namespace std::execution {
class task_scheduler;
}
概要
task_schedulerは、任意のScheduler型を型消去して保持するSchedulerである。
実行制御ライブラリのタスクコルーチン戻り値型task<T, E>において、環境EのデフォルトScheduler型として利用される。
クラス仕様
task_schedulerはschedulerのモデルである。
task_scheduler型のオブジェクトsに対して、SCHED(s)をs.sch_が所有するポインタが指すオブジェクトとする。式get_forward_progress_guarantee(s)はget_forward_progress_guarantee(SCHED(s))と等価。式get_completion_domain<set_value_t>(s)はtask_scheduler::ts-domain()と等価。
task_schedulerクラスは、下記の説明専用メンバ変数を持つ。
メンバ関数
| 名前 | 説明 | 対応バージョン |
|---|---|---|
(constructor) |
コンストラクタ | C++26 |
(destructor) |
デストラクタ | C++26 |
operator= |
代入演算子 | C++26 |
schedule |
スケジュールSenderを返す | C++26 |
メンバ型
| 名前 | 説明 | 対応バージョン |
|---|---|---|
scheduler_concept |
scheduler_tag |
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
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??