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...)};
typename zip_sequences_t::sequences_t sequences_t
Type of the tuples of all the maps.
typename zip_sequences_t::const_iterators_t const_iterators_t
Tuple of const_iterators.
zip_sequences_padded(const value_type &pad, S...sequences)
IteratorsType iterators_type
Underlying iterators.
std::tuple< Sequences... > sequences_t
Type of the tuple of all the maps.
zip_iterator(zip_iterator< OtherValue, OtherIterators > const &that, const padding_t &pad)
std::string type(const automaton &a)
The implementation type of a.
bool next_()
Move to the next position.
const_iterator end() const
typename zip_sequences_t::indices_t indices_t
Index sequence for our sequences.
value_type dereference_(seq< I... >) const
Tuple of values.
typename zip_sequences_t::template zip_iterator< ValueType, IteratorsType > super_t
const_iterator cbegin() const
zip_iterator & operator++()
Advance to next position.
iterator end_(seq< I... >)
zip_sequences_padded(const value_type &pad, const std::tuple< S... > &sequences)
const_iterator cend_(seq< I... >) const
const_iterator cbegin() const
const_iterator begin() const
zip_sequences(const sequences_t &sequences)
bool equal_(const zip_iterator< OtherValue, OtherIterators > &that, seq< I... >) const
bool equal(const zip_iterator< OtherValue, OtherIterators > &that) const
const_iterator cbegin_(seq< I... >) const
typename zip_sequences_t::value_type value_type
The type of the members.
value_type operator*() const
iterator begin_(seq< I... >)
zip_sequences< Sequences... > zip(Sequences &&...seqs)
vcsn::detail::index_sequence< I... > seq
Type of index sequences.
const_iterator end() const
auto tuple(const Auts &...as)
Build the (accessible part of the) tuple.
const_iterator cend() const
typename std::remove_reference< Seq >::type seq_t
The type of the underlying sequences, without reference.
iterator end_(seq< I... >)
const_iterator begin() const
std::tuple< typename seq_t< Sequences >::const_iterator... > const_iterators_t
Tuple of const_iterators.
sequences_t sequences_
The sequences we iterate upon.
std::tuple< typename seq_t< Sequences >::iterator... > iterators_t
Tuple of iterators.
static constexpr size_t size
Number of sequences.
void advance(std::size_t n)
typename zip_sequences_t::iterators_t iterators_t
Tuple of iterators.
const_iterator cbegin_(seq< I... >) const
const iterators_type & iterators() const
iterator begin_(seq< I... >)
zip_sequences(Sequences...sequences)
zip_iterator(const iterators_type &is, const iterators_type &ends, const padding_t &pad)
value_type operator*() const
zip_iterator(zip_iterator< OtherValue, OtherIterators > const &that)
const_iterator cend_(seq< I... >) const
void done_()
We have reached the end, move all the cursors to this end.
zip_iterator(const iterators_type &is, const iterators_type &ends)
bool next_()
Move to the next position.
std::tuple< typename seq_t< Sequences >::value_type... > value_type
The type of the members.
IteratorsType iterators_type
Underlying iterators.
const_iterator cend() const
iterators_type is_
The current position.
friend class boost::iterator_core_access
value_type dereference_(seq< I... >) const
Tuple of values.
zip_sequences_padded< zip_sequences< Sequences... > > zip_with_padding(const std::tuple< typename Sequences::value_type... > &pad, const Sequences &...seq)
ZipSequences zip_sequences_t
Type of the wrapped zip sequence.
zip_iterator & operator++()
Advance to next position.
iterators_type ends_
The ends.
const iterators_type & end() const
zip_sequences< Sequences... > zip_tuple(const std::tuple< Sequences... > &seqs)