20 #ifndef GRPPI_COMMON_ITERATION_PATTERN_H 21 #define GRPPI_COMMON_ITERATION_PATTERN_H 23 #include <type_traits> 32 template <
typename Transformer,
typename Predicate>
48 template <
typename Item>
50 return predicate_(std::forward<Item>(item));
56 template <
typename Item>
58 return transform_(std::forward<Item>(item));
70 Transformer transform_;
79 template<
typename T,
typename P>
Definition: callable_traits.h:26
iteration_t(Transformer &&t, Predicate &&p) noexcept
Constructs a iteration with a predicate.
Definition: iteration_pattern.h:40
auto transform(Item &&item) const
Applies the transformation over a data item.
Definition: iteration_pattern.h:57
typename std::enable_if_t< is_iteration< T >, int > requires_iteration
Definition: iteration_pattern.h:88
auto operator()(T &&item)
Applies the transformation over a data item.
Definition: iteration_pattern.h:65
static constexpr bool is_iteration
Definition: iteration_pattern.h:85
Definition: iteration_pattern.h:77
bool predicate(Item &&item) const
Invokes the predicate of the iteration over a data item.
Definition: iteration_pattern.h:49
Representation of iteration pattern. Represents a iteration that can be used as a stage on a pipeline...
Definition: iteration_pattern.h:33