21 #ifndef GRPPI_COMMON_ITERATOR_H 22 #define GRPPI_COMMON_ITERATOR_H 31 template <
typename F,
typename ... Iterators,
template<
typename...>
class T, std::size_t ... I>
34 T<Iterators...> & iterators,
35 std::index_sequence<I...>)
37 return std::forward<F>(f)(*std::get<I>(iterators)++...);
62 template <
typename F,
typename ... Iterators,
template <
typename ...>
class T>
65 T<Iterators...> & iterators)
67 constexpr std::size_t size =
sizeof...(Iterators);
69 std::make_index_sequence<size>());
74 template <
typename F,
typename ... Iterators,
template <
typename...>
class T,
78 T<Iterators...> & iterators,
79 std::index_sequence<I...>)
81 return std::forward<F>(f)(std::get<I>(iterators)++...);
105 template <
typename F,
typename ... Iterators,
template <
typename...>
class T>
108 T<Iterators...> & iterators)
110 constexpr std::size_t size =
sizeof...(Iterators);
112 std::make_index_sequence<size>());
117 template <
typename F,
typename T, std::size_t ... I>
119 std::index_sequence<I...>)
121 return std::forward<F>(f)(std::get<I>(t)[i]...);
146 template <
typename F,
typename T>
149 using tuple_raw_type = std::decay_t<T>;
150 constexpr std::size_t size = std::tuple_size<tuple_raw_type>::value;
152 std::forward<T>(t), i, std::make_index_sequence<size>());
157 template <
typename T, std::size_t ... I>
160 std::next(std::get<I>(t), n)...
174 template <
typename T>
176 using tuple_raw_type = std::decay_t<T>;
177 constexpr std::size_t size = std::tuple_size<tuple_raw_type>::value;
179 std::make_index_sequence<size>());
187 template <
typename ... InputIt>
192 type { 0, (in += delta, 0) ...};
197 template <
typename ... InputIt>
202 type { 0, (in++, 0) ...};
Definition: callable_traits.h:26
auto iterators_next(T &&t, int n)
Computes next n steps from a tuple of iterators.
Definition: iterator.h:175
decltype(auto) apply_iterators_indexed(F &&f, T &&t, std::size_t i)
Applies a callable object to the values obtained from the iterators in a tuple by indexing...
Definition: iterator.h:147
decltype(auto) apply_increment(F &&f, T< Iterators... > &iterators, std::index_sequence< I... >)
Definition: iterator.h:76
decltype(auto) apply_deref_increment(F &&f, T< Iterators... > &iterators, std::index_sequence< I... >)
Definition: iterator.h:32
void advance_iterators(size_t delta, InputIt &...in)
Definition: iterator.h:188
decltype(auto) apply_iterators_indexed_impl(F &&f, T &&t, std::size_t i, std::index_sequence< I... >)
Definition: iterator.h:118
auto iterators_next_impl(T &&t, int n, std::index_sequence< I... >)
Definition: iterator.h:158