summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/STLExtras.h
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-30 07:45:09 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-05-30 07:45:09 +0000
commit1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3 (patch)
tree8270002e01ac2d7a63df83b17a3be8e2c9969226 /include/llvm/ADT/STLExtras.h
parentf561b08d67788e4570529b13938b65f097b2ac52 (diff)
downloadllvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.tar.gz
llvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.tar.bz2
llvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.tar.xz
Add comparator useful for natural comparisons on collections with
pointers to objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/STLExtras.h')
-rw-r--r--include/llvm/ADT/STLExtras.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h
index 233b7438a4..961407f504 100644
--- a/include/llvm/ADT/STLExtras.h
+++ b/include/llvm/ADT/STLExtras.h
@@ -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: