[PATCH] D30246: [ADT] Fix zip iterator interface.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 22 05:38:16 PST 2017


dberlin added a comment.

Thanks for doing this, i'll give it a shot and report back :)



================
Comment at: include/llvm/ADT/STLExtras.h:363
+                         std::tuple<decltype(*std::declval<Iters>())...>,
+                         std::ptrdiff_t,
+                         std::tuple<decltype(*std::declval<Iters>())...> *,
----------------
This is not correct, AFAIK:
The difference type is actually the difference type of the first iterator template argument:

  typedef typename std::tuple_element<0, std::tuple<Iters...> >::type temp;
  typedef typename std::iterator_traits<temp>::difference_type difference_type;

(see what boost does, which is similar.
It's possible to do this without the tuple trick, but it requires similar meta-programming)



Repository:
  rL LLVM

https://reviews.llvm.org/D30246





More information about the llvm-commits mailing list