44 template<
class Executor>
class Graph {
52 const auto middle = p(first, last);
79 template<
class I,
class S,
class Fun>
82 traits::is_input_iterator_v<I> &&
83 traits::is_sentinel_for_v<S, I> &&
84 traits::is_indirectly_unary_invocable_v<Fun, I> &&
85 std::is_copy_constructible_v<Fun>
87 )
static constexpr void run(
I first,
S last,
Fun f) {
88 std::for_each(first, last, std::move(f));
103 template<
class E,
class P,
class I,
class S,
class Fun>
106 traits::is_executor_v<E> &&
107 traits::is_partitioner_v<P, I, S> &&
108 traits::is_input_iterator_v<I> &&
109 traits::is_sentinel_for_v<S, I> &&
110 traits::is_indirectly_unary_invocable_v<Fun, I> &&
111 std::is_copy_constructible_v<Fun>
114 if constexpr(traits::is_inline_executor_v<E>) {
115 co_return run(first, last, f);
117 co_return co_await Graph<E>(executor).launch(p, first, last, f);
A partitioner is a light callable object that takes a pair of iterators and returns the middle of the...
Identify traits for algorithms, like we do for other types The traits help us generate auxiliary algo...
Internal class that takes care of the for-eaching tasks and its incomplete tasks.
Definition ForEach.hpp:44
Async launch(P p, I first, S last, Fun f)
Definition ForEach.hpp:51
Graph(const Executor &executor)
Definition ForEach.hpp:49
const Executor & mExecutor
Definition ForEach.hpp:46
Functor representing the overloads for the for_each function.
Definition ForEach.hpp:23
static constexpr void run(I first, S last, Fun f)
Complete overload of the for_each algorithm.
Definition ForEach.hpp:87
static Async run(const E &executor, P p, I first, S last, Fun f)
Complete overload of the for_each algorithm.
Definition ForEach.hpp:113
Overloads for unary invoke algorithms.
Definition UnaryAlgorithm.hpp:34
Definition Application.hpp:19
auto with(Executor executor)
Definition ExecutionContext.hpp:546
cti::continuable< Args... > Async
Defines a non-copyable continuation type which uses the function2 backend for type erasure.
Definition Async.hpp:22
constexpr ForEachAlgorithmFunctor for_each
Applies a function to a range of elements.
Definition ForEach.hpp:123
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25