Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
zip_iterator< T > Class Template Reference

An iterator that merges multiple other iterators. More...

#include <zip_iterator.hpp>

Public Types

using value_type
using reference = value_type
using pointer = value_type*
using difference_type = std::ptrdiff_t
using iterator_category

Public Member Functions

 zip_iterator (T iterators)
 zip_iterator (const zip_iterator &other)
 zip_iterator (zip_iterator &&other)
zip_iteratoroperator= (zip_iterator &&other)
zip_iterator copy ()
bool operator== (const zip_iterator &other) const
bool operator!= (const zip_iterator &other) const
zip_iteratoroperator++ ()
zip_iterator operator++ (int)
void operator-- ()
zip_iterator operator+ (std::ptrdiff_t offset)
zip_iterator operator- (std::ptrdiff_t offset)
zip_iteratoroperator= (const zip_iterator &other)
reference operator* ()

Detailed Description

template<typename T>
class zip_iterator< T >

An iterator that merges multiple other iterators.

Member Typedef Documentation

◆ iterator_category

template<typename T>
using zip_iterator< T >::iterator_category
Initial value:
decltype(
+min_by(
hana::transform(
[](auto el) { return hana::type_c<iterator_category_t<typename decltype(+el)::type>>; }
),
[](auto el) {
return _iterator_category_tag_index(el);
},
hana::type_c<std::random_access_iterator_tag>
)
)::type
Definition zip_iterator.hpp:27

◆ reference

template<typename T>
using zip_iterator< T >::reference = value_type

Because we always return a freshly constructed tuple (an rvalue), we cannot return a reference to something that has no definitive memory location. Therefore, a reference is always equal to a plain old value.

◆ value_type

template<typename T>
using zip_iterator< T >::value_type
Initial value:
decltype(
+hana::unpack(
hana::transform(
[](auto t) {
using It = typename decltype(t)::type;
return hana::type_c<std::iter_value_t<It>>;
}
),
hana::template_<std::tuple>
)
)::type

The documentation for this class was generated from the following file: