16 template <
typename Dereference =
as_tuple,
typename... Maps>
23 template <std::size_t... I>
41 using iterator_t =
typename std::remove_reference_t<T>::const_iterator;
45 using value_t =
typename std::remove_reference_t<T>::value_type;
58 = std::remove_const_t<typename tuple_element_t<0, values_t>::first_type>;
61 = std::tuple<const typename std::remove_reference_t<Maps>::mapped_type&...>;
130 if (std::get<0>(is_) == std::get<0>(ends_))
138 if (is_done_ || k == k2)
148 template <std::size_t... I>
151 using swallow =
int[];
152 (
void) swallow{ (!is_done_ && (k = align_<I>(k),
false))... };
158 template <std::
size_t I>
162 auto& first = std::get<I>(
is_);
166 while (first != std::get<I>(ends_)
167 && std::get<I>(zip_.
maps_).key_comp()(first->first, k))
169 if (first == std::get<I>(ends_))
178 template <std::size_t... I>
181 for (
auto n: {(std::get<I>(
is_) != std::get<I>(that.
is_))...})
190 return std::get<0>(
is_)->first;
194 template <std::size_t... I>
203 template <std::size_t... I>
229 template <std::size_t... I>
237 template <std::size_t... I>
248 template <
typename Dereference =
as_pair,
typename... Maps>
252 return {std::forward<Maps>(maps)...};
255 template <
typename Dereference =
as_pair,
typename... Maps>
typename std::remove_reference_t< T >::const_iterator iterator_t
typename std::remove_reference_t< T >::value_type value_t
references_t dereference_(seq< I... >) const
Tuple of pairs.
std::tuple< const typename std::remove_reference_t< Maps >::mapped_type &... > mapped_t
Tuple of mapped types.
bool not_equal_(const iterator &that, seq< I... >) const
void done_()
We have reached the end, move all the cursors to this end.
auto dereference_(as_tuple) -> references_t
Return as <, , ...>.
std::tuple< Maps... > maps_t
Type of the tuple of all the maps.
zipped_maps(const maps_t &maps)
auto operator*() -> decltype(this->dereference_(Dereference()))
std::remove_const_t< typename tuple_element_t< 0, values_t >::first_type > key_t
Common key type.
zip_sequences< Sequences... > zip(Sequences &&...seqs)
zipped_maps< Dereference, Maps... > zip_maps(Maps &&...maps)
std::tuple< value_t< Maps >... > values_t
key_t align_(key_t k, seq< I... >)
Try to align all the ranges to support key k.
key_t align_(key_t k)
Given the current candidate key, try to find the proper range for I.
zipped_maps< Dereference, Maps... > zip_map_tuple(const std::tuple< Maps... > &maps)
iterators_t is_
The current position.
mapped_t dereference_second_(seq< I... >) const
The associated tuple of values.
std::tuple< iterator_t< Maps >... > iterators_t
bool operator!=(const iterator &that) const
auto tuple(const Auts &...as)
Build the (accessible part of the) tuple.
std::pair< iterator_t< T >, iterator_t< T >> range_t
iterator & operator++()
Advance to next position.
std::tuple< const value_t< Maps > &... > references_t
iterator begin_(seq< I... >)
void align_()
Align all iterators on the first common key.
iterator end_(seq< I... >)
bool is_done_
Whether we reached the end.
key_t dereference_first_() const
The common key.
std::tuple< range_t< Maps >... > ranges_t
iterator(zipped_maps &zip, iterator_t< Maps >...is, iterator_t< Maps >...ends)
iterators_t ends_
The genuine ends.
auto dereference_(as_pair) -> std::pair< key_t, mapped_t >
Return as >.
zipped_maps & zip_
The maps etc.