16 #ifndef GRPPI_COMMON_ITERATION_PATTERN_H
17 #define GRPPI_COMMON_ITERATION_PATTERN_H
19 #include <type_traits>
28 template <
typename Transformer,
typename Predicate>
44 template <
typename Item>
46 return predicate_(std::forward<Item>(item));
52 template <
typename Item>
54 return transform_(std::forward<Item>(item));
66 Transformer transform_;
75 template<
typename T,
typename P>
Representation of iteration pattern. Represents a iteration that can be used as a stage on a pipeline...
Definition: iteration_pattern.h:29
auto transform(Item &&item) const
Applies the transformation over a data item.
Definition: iteration_pattern.h:53
bool predicate(Item &&item) const
Invokes the predicate of the iteration over a data item.
Definition: iteration_pattern.h:45
auto operator()(T &&item)
Applies the transformation over a data item.
Definition: iteration_pattern.h:61
iteration_t(Transformer &&t, Predicate &&p) noexcept
Constructs a iteration with a predicate.
Definition: iteration_pattern.h:36
Definition: callable_traits.h:21
typename std::enable_if_t< is_iteration< T >, int > requires_iteration
Definition: iteration_pattern.h:84
static constexpr bool is_iteration
Definition: iteration_pattern.h:81
Definition: iteration_pattern.h:73