diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index f6a1bd89bbe8c..79b145632d5a1 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -26,7 +26,6 @@ #include "llvm/Config/abi-breaking.h" #include "llvm/Support/ErrorHandling.h" #include -#include #include #include #include @@ -787,9 +786,8 @@ struct zip_common : public zip_traits { template bool test_all_equals(const zip_common &other, std::index_sequence) const { - return all_of(std::initializer_list{std::get(this->iterators) == - std::get(other.iterators)...}, - identity{}); + return ((std::get(this->iterators) == std::get(other.iterators)) && + ...); } public: @@ -833,10 +831,8 @@ class zip_shortest : public zip_common, Iters...> { template bool test(const zip_shortest &other, std::index_sequence) const { - return all_of( - std::array({std::get(this->iterators) != - std::get(other.iterators)...}), - identity{}); + return ((std::get(this->iterators) != std::get(other.iterators)) && + ...); } public: @@ -966,10 +962,8 @@ class zip_longest_iterator template bool test(const zip_longest_iterator &other, std::index_sequence) const { - return llvm::any_of( - std::initializer_list{std::get(this->iterators) != - std::get(other.iterators)...}, - identity{}); + return ((std::get(this->iterators) != std::get(other.iterators)) || + ...); } template value_type deref(std::index_sequence) const {