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

履歴 編集

function
<execution>

std::execution::task_scheduler::コンストラクタ(C++26)

template <class Sch, class Allocator = allocator<void>>
  requires(!same_as<task_scheduler, remove_cvref_t<Sch>>) && scheduler<Sch>
explicit task_scheduler(Sch&& sch, Allocator alloc = {});  // (1)

task_scheduler(const task_scheduler&) = default;  // (2)

概要

  • (1) : Schedulerschとアロケータallocを保持するtask_schedulerオブジェクトを構築する。
  • (2) : ムーブコンストラクタ

テンプレートパラメータ制約

(1) : Schtask_schedulerではなく、schedulerを満たす。

効果

(1) 説明専用のメンバ変数sch_allocate_shared<remove_cvref_t<Sch>>(alloc, std::forward<Sch>(sch))で初期化する。

備考

(1) 処理系は小さなSchedulerオブジェクトに対して動的メモリ確保を避けることが推奨される。

*this上の呼び出しによってえられるts-senderstateオブジェクトの構築では、allocのコピーを用いてメモリ確保が行われる。

バージョン

言語

  • C++26

処理系

関連項目

参照