16 #ifndef GRPPI_REDUCE_H
17 #define GRPPI_REDUCE_H
48 template <
typename Execution,
typename InputIt,
typename Result,
typename Combiner,
49 requires_iterator<InputIt> = 0>
51 InputIt first, std::size_t size,
53 Combiner && combine_op)
55 static_assert(supports_reduce<Execution>(),
56 "reduce not supported on execution type");
59 return ex.reduce(first, size,
60 std::forward<Result>(identity), std::forward<Combiner>(combine_op));
77 template <
typename Execution,
typename InputIt,
typename Result,
typename Combiner,
78 requires_iterator<InputIt> = 0>
80 InputIt first, InputIt last,
82 Combiner && combine_op)
84 static_assert(supports_reduce<Execution>(),
85 "reduce not supported on execution type");
88 return ex.reduce(first, std::distance(first,last),
89 std::forward<Result>(identity), std::forward<Combiner>(combine_op));
auto reduce(const Execution &ex, InputIt first, std::size_t size, Result &&identity, Combiner &&combine_op)
Invoke Reduce pattern with identity value on a data sequence with sequential execution.
Definition: reduce.h:50
Definition: callable_traits.h:21