aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-21 08:38:06 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-21 08:38:06 +0000
commit7b32639362c4cbb438d71492897d9f84c89d9e57 (patch)
tree7ab021a33b2abf037fb375fe9c18a9e235225915 /include/llvm/ADT
parent3b1af0b3fc492dee8d1cd993e6d22142fe2ee7d3 (diff)
downloadexternal_llvm-7b32639362c4cbb438d71492897d9f84c89d9e57.zip
external_llvm-7b32639362c4cbb438d71492897d9f84c89d9e57.tar.gz
external_llvm-7b32639362c4cbb438d71492897d9f84c89d9e57.tar.bz2
Add greater_ptr functor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r--include/llvm/ADT/STLExtras.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h
index 961407f..b6379d2 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:
//