| 67 | |
| 68 | /** Iterator for the dataset. */ |
| 69 | struct iterator |
| 70 | { |
| 71 | /** Construct an iterator. |
| 72 | * |
| 73 | * @param[in] iter1 Iterator 1. |
| 74 | * @param[in] iter2 Iterator 2. |
| 75 | */ |
| 76 | iterator(iter1_type iter1, iter2_type iter2) : _iter1{std::move(iter1)}, _iter2{std::move(iter2)} |
| 77 | { |
| 78 | } |
| 79 | |
| 80 | /** Get the description of the current value. |
| 81 | * |
| 82 | * @return description of the current value. |
| 83 | */ |
| 84 | std::string description() const |
| 85 | { |
| 86 | return _iter1.description() + ":" + _iter2.description(); |
| 87 | } |
| 88 | |
| 89 | /** Get the value of the iterator. |
| 90 | * |
| 91 | * @return the value of the iterator. |
| 92 | */ |
| 93 | ZipDataset::type operator*() const |
| 94 | { |
| 95 | return std::tuple_cat(*_iter1, *_iter2); |
| 96 | } |
| 97 | |
| 98 | /** Inrement the iterator. |
| 99 | * |
| 100 | * @return *this; |
| 101 | */ |
| 102 | iterator &operator++() |
| 103 | { |
| 104 | ++_iter1; |
| 105 | ++_iter2; |
| 106 | return *this; |
| 107 | } |
| 108 | |
| 109 | private: |
| 110 | iter1_type _iter1; |
| 111 | iter2_type _iter2; |
| 112 | }; |
| 113 | |
| 114 | /** Iterator pointing at the begin of the dataset. |
| 115 | * |