run-loop-scheduler get_scheduler();
概要
run_loop上で実行するSchedulerを返す。
戻り値
run_loopインスタンス上で作業をスケジュールするrun-loop-schedulerインスタンスを返す。
例
#include <cassert>
#include <concepts>
#include <execution>
namespace ex = std::execution;
int main()
{
ex::run_loop loop;
ex::scheduler auto sch = loop.get_scheduler();
// スケジュールSenderを作成
ex::sender auto sndr = ex::schedule(sch);
// スケジュールSenderの完了シグネチャ集合を確認
using Sigs = ex::completion_signatures_of_t<decltype(sndr)>;
static_assert(std::same_as<Sigs,
ex::completion_signatures<ex::set_value_t(),
ex::set_error_t(std::exception_ptr),
ex::set_stopped_t()>>);
// スケジュールSender属性の値完了Schedulerを確認
auto compl_sch = ex::get_completion_scheduler<ex::set_value_t>(ex::get_env(sndr));
assert(compl_sch == sch);
}
出力
バージョン
言語
- C++26
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??