[PATCH] D26999: Add some functions to search ArrayRefs

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 14:40:33 PST 2016


zturner added inline comments.


================
Comment at: include/llvm/ADT/ArrayRef.h:173
+    /// \p From, or npos if not found.
+    size_t find_if(function_ref<bool(const T &)> F, size_t From = 0) const {
+      ArrayRef<T> S = drop_front(From);
----------------
chandlerc wrote:
> These are already inline functions, why not make them templates and use generic callables?
joker-eph pointed me to `llvm::find_if()`, I think I will add `llvm::find_if_not()`, then have the functions use that, and that should address both of your comments at the same time.


https://reviews.llvm.org/D26999





More information about the llvm-commits mailing list