33 template <
typename ContextType, SomeOutcome OutcomeType>
34 [[nodiscard]]
static auto
35 dispatch(ContextType& ctx, OutcomeType&& outcome,
auto&& fn)
37 auto op = outcome.getOperation();
41 [outcome = std::forward<
decltype(outcome)>(outcome),
42 fn = std::forward<
decltype(fn)>(fn)](
auto yield)
mutable {
43 if constexpr (SomeStoppableOutcome<OutcomeType>) {
44 auto& stopSource = outcome.getStopSource();
45 fn(outcome, stopSource, stopSource[yield]);
57 template <
typename ContextType, SomeOutcome OutcomeType>
58 [[nodiscard]]
static auto
59 dispatch(ContextType& ctx, OutcomeType&& outcome,
auto&& fn)
61 auto op = outcome.getOperation();
65 [outcome = std::forward<
decltype(outcome)>(outcome), fn = std::forward<
decltype(fn)>(fn)]()
mutable {
66 if constexpr (SomeStoppableOutcome<OutcomeType>) {
67 auto& stopSource = outcome.getStopSource();
68 fn(outcome, stopSource, stopSource.getToken());
80 template <
typename ContextType, SomeOutcome OutcomeType>
81 [[nodiscard]]
static auto
82 dispatch([[maybe_unused]] ContextType& ctx, OutcomeType outcome,
auto&& fn)
84 auto op = outcome.getOperation();
87 auto& stopSource = outcome.getStopSource();
88 fn(outcome, stopSource, stopSource.getToken());
Definition Execution.hpp:56