Add comparator useful for natural comparisons on collections with
[oota-llvm.git] / include / llvm / ADT / STLExtras.h
index 233b7438a4d51a8142d4e59b35635fbfa7702f5c..961407f5040c84647ed1a187c8e7edc41f30527f 100644 (file)
@@ -53,6 +53,12 @@ struct bitwise_or : public std::binary_function<Ty, Ty, bool> {
   }
 };
 
+template<class Ty>
+struct less_ptr : public std::binary_function<Ty, Ty, bool> {
+  bool operator()(const Ty* left, const Ty* right) const {
+    return *left < *right;
+  }
+};
 
 // deleter - Very very very simple method that is used to invoke operator
 // delete on something.  It is used like this: