[all-commits] [llvm/llvm-project] b70de6: Add `all_of_zip` to STLExtras

Mehdi Amini via All-commits all-commits at lists.llvm.org
Wed Jul 28 22:00:54 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b70de61f48062c7810b474bc944394ecbd56a262
      https://github.com/llvm/llvm-project/commit/b70de61f48062c7810b474bc944394ecbd56a262
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2021-07-29 (Thu, 29 Jul 2021)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/unittests/ADT/STLExtrasTest.cpp

  Log Message:
  -----------
  Add `all_of_zip` to STLExtras

This takes two ranges and invokes a predicate on the element-wise pair in the
ranges. It returns true if all the pairs are matching the predicate and the ranges
have the same size.
It is useful with containers that aren't random iterator where we can't check the
sizes in O(1).

Differential Revision: https://reviews.llvm.org/D106605




More information about the All-commits mailing list