Index: include/llvm/ADT/STLExtras.h =================================================================== --- include/llvm/ADT/STLExtras.h +++ include/llvm/ADT/STLExtras.h @@ -386,6 +386,13 @@ return std::find(Range.begin(), Range.end(), val); } +/// Returns true if \p Container contains \p Element. +template +bool contains(const T &Container, const E &Element) { + return std::find(Container.begin(), Container.end(), Element) != + Container.end(); +} + //===----------------------------------------------------------------------===// // Extra additions to //===----------------------------------------------------------------------===//