最終更新日時(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) : ムーブコンストラクタ

適格要件

Schinfallible-scheduler<env<>>を満たす。

効果

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

備考

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

*this上の任意の呼び出しによるメモリ確保では、allocのコピーが用いられる。

バージョン

言語

  • C++26

処理系

参照