This patch:
- Ensures that zip_first/zip_shortest inherit from the iterator_facade_base (which it should);
- marks zippy::begin/::end const;
- and ensures that zip plays well with make_filter_range.
Differential D30246
[ADT] Fix zip iterator interface. bryant on Feb 22 2017, 1:33 AM. Authored by
Details This patch:
Diff Detail
Event TimelineComment Actions Thanks for doing this, i'll give it a shot and report back :)
Comment Actions If you change it to:
+++ b/include/llvm/ADT/STLExtras.h iterator_facade_base<ZipType, std::input_iterator_tag, std::tuple<decltype(*std::declval<Iters>())...>,
+ typename std::iterator_traits<typename std::tuple_element< std::tuple<decltype(*std::declval<Iters>())...> *, std::tuple<decltype(*std::declval<Iters>())...>>; I think this would be ready to go in :) Comment Actions
|
This is not correct, AFAIK:
The difference type is actually the difference type of the first iterator template argument:
(see what boost does, which is similar.
It's possible to do this without the tuple trick, but it requires similar meta-programming)