diff options
Diffstat (limited to 'llvm/include/llvm/ADT/STLExtras.h')
-rw-r--r-- | llvm/include/llvm/ADT/STLExtras.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 0d547c29572..11be19607f8 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -383,6 +383,14 @@ bool any_of(R &&Range, UnaryPredicate &&P) { std::forward<UnaryPredicate>(P)); } +/// Provide wrappers to std::none_of which take ranges instead of having to pass +/// begin/end explicitly. +template <typename R, class UnaryPredicate> +bool none_of(R &&Range, UnaryPredicate &&P) { + return std::none_of(Range.begin(), Range.end(), + std::forward<UnaryPredicate>(P)); +} + /// Provide wrappers to std::find which take ranges instead of having to pass /// begin/end explicitly. template<typename R, class T> |