16 #ifndef GRPPI_COMMON_ITERATOR_H
17 #define GRPPI_COMMON_ITERATOR_H
26 template <
typename F,
typename ... Iterators,
template<
typename...>
class T, std::size_t ... I>
29 T<Iterators...> & iterators,
30 std::index_sequence<I...>)
32 return std::forward<F>(f)(*std::get<I>(iterators)++...);
57 template <
typename F,
typename ... Iterators,
template <
typename ...>
class T>
60 T<Iterators...> & iterators)
62 constexpr std::size_t size =
sizeof...(Iterators);
64 std::make_index_sequence<size>());
69 template <
typename F,
typename ... Iterators,
template <
typename...>
class T,
73 T<Iterators...> & iterators,
74 std::index_sequence<I...>)
76 return std::forward<F>(f)(std::get<I>(iterators)++...);
100 template <
typename F,
typename ... Iterators,
template <
typename...>
class T>
103 T<Iterators...> & iterators)
105 constexpr std::size_t size =
sizeof...(Iterators);
107 std::make_index_sequence<size>());
112 template <
typename F,
typename T, std::size_t ... I>
114 std::index_sequence<I...>)
116 return std::forward<F>(f)(std::get<I>(t)[i]...);
141 template <
typename F,
typename T>
144 using tuple_raw_type = std::decay_t<T>;
145 constexpr std::size_t size = std::tuple_size<tuple_raw_type>::value;
147 std::forward<T>(t), i, std::make_index_sequence<size>());
152 template <
typename T, std::size_t ... I>
155 std::next(std::get<I>(t), n)...
169 template <
typename T>
171 using tuple_raw_type = std::decay_t<T>;
172 constexpr std::size_t size = std::tuple_size<tuple_raw_type>::value;
174 std::make_index_sequence<size>());
182 template <
typename ... InputIt>
187 type { 0, (in += delta, 0) ...};
192 template <
typename ... InputIt>
197 type { 0, (in++, 0) ...};
decltype(auto) apply_deref_increment(F &&f, T< Iterators... > &iterators, std::index_sequence< I... >)
Definition: iterator.h:27
decltype(auto) apply_increment(F &&f, T< Iterators... > &iterators, std::index_sequence< I... >)
Definition: iterator.h:71
auto iterators_next_impl(T &&t, int n, std::index_sequence< I... >)
Definition: iterator.h:153
decltype(auto) apply_iterators_indexed_impl(F &&f, T &&t, std::size_t i, std::index_sequence< I... >)
Definition: iterator.h:113
Definition: callable_traits.h:21
decltype(auto) apply_increment(F &&f, T< Iterators... > &iterators)
Applies a callable object to the iterators in a tuple like-object and the increments those iterators....
Definition: iterator.h:101
auto iterators_next(T &&t, int n)
Computes next n steps from a tuple of iterators.
Definition: iterator.h:170
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:142
void advance_iterators(size_t delta, InputIt &... in)
Definition: iterator.h:183
decltype(auto) apply_deref_increment(F &&f, T< Iterators... > &iterators)
Applies a callable object to the values obtained from the iterators in a tuple-like object....
Definition: iterator.h:58