1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

Add llvm::equal convenient wrapper for ranges around std::equal

Differential Revision: https://reviews.llvm.org/D106913
This commit is contained in:
Mehdi Amini 2021-07-27 20:06:27 +00:00
parent 409f0eedd6
commit 115164b68b

View File

@ -1688,6 +1688,13 @@ auto unique(Range &&R, Predicate P) {
return std::unique(adl_begin(R), adl_end(R), P);
}
/// Wrapper function around std::equal to detect if pair-wise elements between
/// two ranges are the same.
template <typename L, typename R> bool equal(L &&LRange, R &&RRange) {
return std::equal(adl_begin(LRange), adl_end(LRange), adl_begin(RRange),
adl_end(RRange));
}
/// Wrapper function around std::equal to detect if all elements
/// in a container are same.
template <typename R>