[PATCH] D22951: [ADT] Add filter_iterator for filtering elements

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 14:30:01 PDT 2016


timshen marked an inline comment as done.

================
Comment at: include/llvm/ADT/STLExtras.h:317
@@ +316,3 @@
+/// lifetime of that temporary is not kept by the returned range object, and the
+/// temporary is going to be dropped on the floor after the make_iterator_range
+/// full expression that contains this function call.
----------------
Added a comment with "FIXME".

================
Comment at: unittests/Support/IteratorTest.cpp:182
@@ +181,3 @@
+  auto Range = make_filter_range(
+      make_range(InputIterator(std::begin(A)), InputIterator(std::end(A))),
+      IsOdd);
----------------
For this specific one it needs to be make_range(InputIterator(std::begin(A)), InputIterator(std::end(A))), because otherwise the iterator is random access iterator.

For others I have removed the unnecessary make_range calls.


https://reviews.llvm.org/D22951





More information about the llvm-commits mailing list