Iros
 
Loading...
Searching...
No Matches
execute.h
Go to the documentation of this file.
1#pragma once
2
11#include "di/meta/util.h"
12#include "di/platform/prelude.h"
13
14namespace di::execution {
15namespace execute_ns {
16 struct Function {
17 template<concepts::Scheduler Sched, concepts::MovableValue Fun, concepts::Allocator Alloc = DefaultAllocator>
19 auto operator()(Sched&& scheduler, Fun&& function, Alloc&& allocator = {}) const {
21 return function::tag_invoke(*this, util::forward<Sched>(scheduler), util::forward<Fun>(function),
22 util::forward<Alloc>(allocator));
23 } else {
24 return start_detached(then(schedule(scheduler), util::forward<Fun>(function)),
25 util::forward<Alloc>(allocator));
26 }
27 }
28 };
29}
30
45constexpr inline auto execute = execute_ns::Function {};
46}
Definition invoke.h:58
Definition tag_invoke.h:33
Definition execute.h:15
Definition bulk.h:30
constexpr auto start_detached
Start a sender without waiting for it to complete.
Definition start_detached.h:134
constexpr auto schedule
Definition schedule.h:17
constexpr auto then
A sender that maps values into another value.
Definition then.h:276
constexpr auto execute
Executes a function on a scheduler.
Definition execute.h:45
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
Definition as_bool.h:8
Defines the sequence sender concepts and related CPOs.