[all-commits] [llvm/llvm-project] c9e52f: [ADT] Add all_equal predicate
Jakub Kuderski via All-commits
all-commits at lists.llvm.org
Mon Aug 22 21:01:25 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c9e52fbe4d4fa37a87b2855ad7e118dcdee2db68
https://github.com/llvm/llvm-project/commit/c9e52fbe4d4fa37a87b2855ad7e118dcdee2db68
Author: Jakub Kuderski <kubak at google.com>
Date: 2022-08-22 (Mon, 22 Aug 2022)
Changed paths:
M llvm/include/llvm/ADT/STLExtras.h
M llvm/unittests/ADT/STLExtrasTest.cpp
Log Message:
-----------
[ADT] Add all_equal predicate
`llvm::all_equal` checks if all values in the given range are equal, i.e., there are no two elements that are not equal.
Similar to `llvm::all_of`, it returns `true` when the range is empty.
`llvm::all_equal` is intended to supersede `llvm::is_splat`, which will be deprecated and removed in future patches.
See the discussion thread for more details:
https://discourse.llvm.org/t/adt-is-splat-and-empty-ranges/64692.
Reviewed By: dblaikie, shchenz
Differential Revision: https://reviews.llvm.org/D132334
More information about the All-commits
mailing list