[PATCH] D106605: Add `all_of_zip` to STLExtras

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 11:16:48 PDT 2021


mehdi_amini added inline comments.


================
Comment at: llvm/include/llvm/ADT/STLExtras.h:1704
+template <typename R, typename U, typename Predicate>
+Optional<bool> all_of_zip(R &&Lhs, U &&Rhs, Predicate P) {
+  auto Literator = adl_begin(Lhs);
----------------
rriddle wrote:
> The name here feels a bit weird. This is essentially just std::ranges::equal/std::equal with special size mismatch behavior. Can we name it something closer to what it would be replaced by? Also, in what situations is the size mismatch result needed (i.e. the llvm::None)?
I was trying to differentiate between "length mismatch" and "element mismatch", but maybe we don't need to?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106605



More information about the llvm-commits mailing list