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.
Paths
| Differential D30246
[ADT] Fix zip iterator interface. ClosedPublic Authored by bryant on Feb 22 2017, 1:33 AM.
Details Summary 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 :) This revision is now accepted and ready to land.Feb 23 2017, 12:21 PM Comment Actions
Closed by commit rL296036: [ADT] Fix zip iterator interface. (authored by bryant). · Explain WhyFeb 23 2017, 3:12 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 89563 include/llvm/ADT/STLExtras.h
unittests/ADT/IteratorTest.cpp
|
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)