[PATCH] D48348: [ADT] Add zip_longest iterators.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 16:27:36 PST 2018


dblaikie added inline comments.


================
Comment at: unittests/ADT/IteratorTest.cpp:333-334
+  using namespace std;
+  const vector<unsigned> pi{3, 1, 4, 1, 5, 9};
+  const vector<unsigned> e{2, 7, 1, 8};
+
----------------
Meinersbur wrote:
> dblaikie wrote:
> > Wonder if it's worth testing with two different (& incompatible) types - like const char* in the second vector, for instance?
> > 
> > Up to you.
> Using StringRef which has an overloaded comparison operator. I get an ambiguity error if just using a literal string in the initializer_list of Optional<StringRef>, so there is an explicit conversion.
Ah, cool - you might be able to get away with {...} instead of StringRef(...) if you like, but yeah, either's fine - thanks!


Repository:
  rL LLVM

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

https://reviews.llvm.org/D48348





More information about the llvm-commits mailing list