21 #ifndef GRPPI_POLY_MAP_H 22 #define GRPPI_POLY_MAP_H 25 #include "../common/support.h" 29 template <
typename InputIt,
typename OutputIt,
typename Transformer>
31 OutputIt first_out, Transformer && op)
35 template <
typename InputIt,
typename OutputIt,
typename Transformer,
36 typename InputIt2,
typename ... OtherInputIts>
38 OutputIt first_out, Transformer && op, InputIt2 first2,
39 OtherInputIts ... more_firsts)
43 template <
typename E,
typename ... O,
44 typename InputIt,
typename OutputIt,
typename Transformer,
47 OutputIt first_out, Transformer && op)
49 map_multi_impl<O...>(e, first, last, first_out, std::forward<Transformer>(op));
52 template <
typename E,
typename ... O,
53 typename InputIt,
typename OutputIt,
typename Transformer,
54 typename InputIt2,
typename ... OtherInputIts,
55 internal::requires_execution_not_supported<E> = 0>
57 OutputIt first_out, Transformer && op, InputIt2 first2,
58 OtherInputIts ... more_firsts)
60 map_multi_impl<O...>(e, first, last, first_out, std::forward<Transformer>(op),
61 first2, more_firsts...);
65 template <
typename E,
typename ... O,
66 typename InputIt,
typename OutputIt,
typename Transformer,
69 OutputIt first_out, Transformer && op)
71 if (
typeid(E) == e.
type()) {
73 first, last, first_out, std::forward<Transformer>(op));
76 map_multi_impl<O...>(e, first, last, first_out, std::forward<Transformer>(op));
80 template <
typename E,
typename ... O,
81 typename InputIt,
typename OutputIt,
typename Transformer,
82 typename InputIt2,
typename ... OtherInputIts,
83 internal::requires_execution_supported<E> = 0>
85 OutputIt first_out, Transformer && op, InputIt2 first2,
86 OtherInputIts ... more_firsts)
88 if (
typeid(E) == e.
type()) {
90 first, last, first_out, std::forward<Transformer>(op), first2,
94 map_multi_impl<O...>(e, first, last, first_out, std::forward<Transformer>(op),
95 first2, more_firsts...);
119 template <
typename InputIt,
typename OutputIt,
typename Transformer>
121 InputIt first, InputIt last, OutputIt first_out,
122 Transformer && transf_op)
129 >(ex, first, last, first_out, std::forward<Transformer>(transf_op));
146 template <
typename InputIt,
typename OutputIt,
typename InputIt2,
147 typename Transformer,
148 typename ... OtherInputIts>
150 OutputIt first_out, Transformer && op, InputIt2 first2, OtherInputIts ... more_firsts)
157 >(ex, first, last, first_out, std::forward<Transformer>(op), first2, more_firsts...);
Definition: callable_traits.h:24
Native parallel execution policy. This policy uses ISO C++ threads as implementation building block a...
Definition: parallel_execution_native.h:136
const std::type_info & type() const noexcept
Definition: polymorphic_execution.h:77
void map_multi_impl(polymorphic_execution &e, InputIt first, InputIt last, OutputIt first_out, Transformer &&op)
Definition: poly/map.h:30
std::enable_if_t< is_supported< E >(), int > requires_execution_supported
Definition: support.h:32
OpenMP parallel execution policy.
Definition: parallel_execution_omp.h:40
TBB parallel execution policy.
Definition: parallel_execution_tbb.h:37
E * execution_ptr()
Get the execution pointer for a given type.
Definition: polymorphic_execution.h:91
Sequential execution policy.
Definition: sequential_execution.h:31
Definition: polymorphic_execution.h:63
std::enable_if_t<!is_supported< E >(), int > requires_execution_not_supported
Definition: support.h:36
void map(parallel_execution_native &ex, InputIt first, InputIt last, OutputIt first_out, Transformer &&transf_op)
Invoke Map pattern on a data sequence with native paralell execution.
Definition: native/map.h:50