[PATCH] D138858: [ADT] Clarify `zip` behavior with iteratees of different lengths

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 00:02:47 PST 2022


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/include/llvm/ADT/STLExtras.h:882-884
 /// zip iterator that, for the sake of efficiency, assumes the first iteratee to
-/// be the shortest.
+/// be the shortest. Iteration continues until the end of the first iteratee is
+/// reached.
----------------
kuhar wrote:
> kuhar wrote:
> > dblaikie wrote:
> > > Worth mentioning what values are used to fill in if the second iteratee isn't long enough?
> > Unless I'm mistaken, that's just UB. The first sentence explains that `zip_first` assumes that the first iteratee is the shortest.
> > 
> > Do you see some better wording here?
> Actually, maybe that would deserve it's own assertion as well.
Ah, I see, fair enough. 

Sure, could add an assertion here if you like - either in this review or separate commit.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138858/new/

https://reviews.llvm.org/D138858



More information about the llvm-commits mailing list