aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/Support/STLExtras.h7
-rw-r--r--include/llvm/ADT/STLExtras.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/include/Support/STLExtras.h b/include/Support/STLExtras.h
index 961407f504..b6379d2623 100644
--- a/include/Support/STLExtras.h
+++ b/include/Support/STLExtras.h
@@ -60,6 +60,13 @@ struct less_ptr : public std::binary_function<Ty, Ty, bool> {
}
};
+template<class Ty>
+struct greater_ptr : public std::binary_function<Ty, Ty, bool> {
+ bool operator()(const Ty* left, const Ty* right) const {
+ return *right < *left;
+ }
+};
+
// deleter - Very very very simple method that is used to invoke operator
// delete on something. It is used like this:
//
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h
index 961407f504..b6379d2623 100644
--- a/include/llvm/ADT/STLExtras.h
+++ b/include/llvm/ADT/STLExtras.h
@@ -60,6 +60,13 @@ struct less_ptr : public std::binary_function<Ty, Ty, bool> {
}
};
+template<class Ty>
+struct greater_ptr : public std::binary_function<Ty, Ty, bool> {
+ bool operator()(const Ty* left, const Ty* right) const {
+ return *right < *left;
+ }
+};
+
// deleter - Very very very simple method that is used to invoke operator
// delete on something. It is used like this:
//