From da4773e8b8100f27ee117005c81e81574f5a9868 Mon Sep 17 00:00:00 2001 From: Regina Pfeifer Date: Fri, 15 Feb 2019 21:45:10 +0100 Subject: cmRange: Add functions all_of, any_of, none_of --- Source/cmRange.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Source/cmRange.h b/Source/cmRange.h index a84ccec..b6d161e 100644 --- a/Source/cmRange.h +++ b/Source/cmRange.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include +#include #include template @@ -55,6 +56,24 @@ public: return std::move(*this); } + template + bool all_of(UnaryPredicate p) const + { + return std::all_of(this->Begin, this->End, std::ref(p)); + } + + template + bool any_of(UnaryPredicate p) const + { + return std::any_of(this->Begin, this->End, std::ref(p)); + } + + template + bool none_of(UnaryPredicate p) const + { + return std::none_of(this->Begin, this->End, std::ref(p)); + } + private: Iter Begin; Iter End; -- cgit v0.12