瀏覽代碼

cmAlgorithms: Add cmFindNot algorithm.

Stephen Kelly 10 年之前
父節點
當前提交
a3a0a8c222
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Source/cmAlgorithms.h

+ 7 - 0
Source/cmAlgorithms.h

@@ -295,4 +295,11 @@ std::string cmWrap(char prefix, Range const& r, char suffix, std::string sep)
   return cmWrap(std::string(1, prefix), r, std::string(1, suffix), sep);
 }
 
+template<typename Range, typename T>
+typename Range::const_iterator cmFindNot(Range const& r, T const& t)
+{
+  return std::find_if(r.begin(), r.end(),
+                      std::bind1st(std::not_equal_to<T>(), t));
+}
+
 #endif