[PATCH] D22951: [ADT] Add filter_iterator for filtering elements
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 1 15:53:41 PDT 2016
dblaikie added inline comments.
================
Comment at: unittests/Support/IteratorTest.cpp:156
@@ +155,3 @@
+ const auto Range = make_filter_range(
+ make_range(InputIterator(a), InputIterator(a + 7)), IsOdd);
+ SmallVector<int, 3> Actual(Range.begin(), Range.end());
----------------
rather than repeating '7' here (the length of the array) you can use llvm::array_lengthof, but probably better than that, just use std::end(a) (and std::begin(a) if you like symmetry). Same goes for other cases of the array length constants in this test file.
https://reviews.llvm.org/D22951
More information about the llvm-commits
mailing list