3 #include <boost/iterator/iterator_facade.hpp>
12 template <
typename... Sequences>
19 template <std::size_t... I>
23 static constexpr
size_t size =
sizeof...(Sequences);
29 template <
typename Seq>
34 = std::tuple<typename seq_t<Sequences>::value_type...>;
46 = std::tuple<typename seq_t<Sequences>::const_iterator...>;
50 = std::tuple<typename seq_t<Sequences>::iterator...>;
53 template <
typename ValueType,
54 typename IteratorsType>
56 :
public boost::iterator_facade<
57 zip_iterator<ValueType, IteratorsType>
59 , boost::forward_traversal_tag
70 template <
typename OtherValue,
typename OtherIterators>
96 for (
size_t i = 0; i < n; ++i)
131 template <std::size_t... I>
135 using swallow =
int[];
139 && (++std::get<I>(
is_) == std::get<I>(ends_)
147 template <
typename OtherValue,
typename OtherIterators>
153 template <
typename OtherValue,
typename OtherIterators,
158 for (
auto n: {(std::get<I>(
is_) == std::get<I>(that.
is_))...})
165 template <std::size_t... I>
209 template <std::size_t... I>
216 template <std::size_t... I>
224 template <std::size_t... I>
231 template <std::size_t... I>
248 template <
typename ZipSequences>
258 template <std::size_t... I>
275 template <
typename... S>
277 const std::tuple<S...>& sequences)
281 template <
typename... S>
286 template <
typename ValueType,
typename IteratorsType>
288 :
public zip_sequences_t::template
zip_iterator<ValueType, IteratorsType>
292 typename zip_sequences_t::template
zip_iterator<ValueType,
304 template <
typename OtherValue,
typename OtherIterators>
307 :
super_t(that.is_, that.ends_)
333 template <std::size_t... I>
337 using swallow =
int[];
340 (std::get<I>(this->
is_) == std::get<I>(this->ends_)
342 : ++std::get<I>(this->
is_) == std::get<I>(this->ends_)
351 template <std::size_t... I>
354 return value_type{(std::get<I>(this->
is_) == std::get<I>(this->ends_)
356 : *std::get<I>(this->is_))...};
399 template <std::size_t... I>
407 template <std::size_t... I>
416 template <std::size_t... I>
424 template <std::size_t... I>
437 template <
typename... Sequences>
441 return {std::forward<Sequences>(seqs)...};
444 template <
typename... Sequences>
451 template <
typename... Sequences>
454 const Sequences&...
seq)
456 return {pad, std::make_tuple(seq...)};
iterator end_(seq< I... >)
bool next_()
Move to the next position.
sequences_t sequences_
The sequences we iterate upon.
const iterators_type & end() const
bool next_()
Move to the next position.
iterator begin_(seq< I... >)
zip_sequences_padded(const value_type &pad, S...sequences)
zip_iterator(const iterators_type &is, const iterators_type &ends)
static constexpr size_t size
Number of sequences.
const_iterator cbegin_(seq< I... >) const
const_iterator cbegin_(seq< I... >) const
zip_iterator(const iterators_type &is, const iterators_type &ends, const padding_t &pad)
zip_sequences_padded(const value_type &pad, const std::tuple< S... > &sequences)
iterators_type ends_
The ends.
IteratorsType iterators_type
Underlying iterators.
const_iterator cend() const
void done_()
We have reached the end, move all the cursors to this end.
const_iterator end() const
const_iterator cend_(seq< I... >) const
value_type dereference_(seq< I... >) const
Tuple of values.
typename zip_sequences_t::indices_t indices_t
Index sequence for our sequences.
const_iterator cend_(seq< I... >) const
const_iterator cend() const
std::tuple< typename seq_t< Sequences >::iterator... > iterators_t
Tuple of iterators.
std::string type(const automaton &a)
The implementation type of a.
bool equal(const zip_iterator< OtherValue, OtherIterators > &that) const
zip_sequences< Sequences... > zip(Sequences &&...seqs)
friend class boost::iterator_core_access
value_type dereference_(seq< I... >) const
Tuple of values.
value_type operator*() const
std::tuple< typename seq_t< Sequences >::value_type... > value_type
The type of the members.
value_type operator*() const
zip_sequences< Sequences... > zip_tuple(const std::tuple< Sequences... > &seqs)
typename zip_sequences_t::value_type value_type
The type of the members.
zip_iterator(zip_iterator< OtherValue, OtherIterators > const &that, const padding_t &pad)
typename zip_sequences_t::iterators_t iterators_t
Tuple of iterators.
std::tuple< typename seq_t< Sequences >::const_iterator... > const_iterators_t
Tuple of const_iterators.
zip_sequences(Sequences...sequences)
zip_iterator & operator++()
Advance to next position.
const iterators_type & iterators() const
iterator end_(seq< I... >)
typename std::remove_reference< Seq >::type seq_t
The type of the underlying sequences, without reference.
auto tuple(const Auts &...as)
Build the (accessible part of the) tuple.
const_iterator end() const
typename zip_sequences_t::sequences_t sequences_t
Type of the tuples of all the maps.
zip_iterator(zip_iterator< OtherValue, OtherIterators > const &that)
const_iterator begin() const
const_iterator cbegin() const
bool equal_(const zip_iterator< OtherValue, OtherIterators > &that, seq< I... >) const
void advance(std::size_t n)
ZipSequences zip_sequences_t
Type of the wrapped zip sequence.
typename zip_sequences_t::template zip_iterator< ValueType, IteratorsType > super_t
zip_sequences_padded< zip_sequences< Sequences... > > zip_with_padding(const std::tuple< typename Sequences::value_type... > &pad, const Sequences &...seq)
typename zip_sequences_t::const_iterators_t const_iterators_t
Tuple of const_iterators.
iterators_type is_
The current position.
iterator begin_(seq< I... >)
zip_sequences(const sequences_t &sequences)
vcsn::detail::index_sequence< I... > seq
Type of index sequences.
zip_iterator & operator++()
Advance to next position.
std::tuple< Sequences... > sequences_t
Type of the tuple of all the maps.
IteratorsType iterators_type
Underlying iterators.
const_iterator begin() const
const_iterator cbegin() const