summaryrefslogtreecommitdiffstats
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
commit34f6bcc8d20fb210f6dde941820bf626665829b8 (patch)
tree28af181707bf7fddd78529397da6774705c493a0
parent7a8734af7fe3663a0136f7f8fcb474661063b026 (diff)
downloadbcm5719-llvm-34f6bcc8d20fb210f6dde941820bf626665829b8.tar.gz
bcm5719-llvm-34f6bcc8d20fb210f6dde941820bf626665829b8.zip
Add comparator useful for natural comparisons on collections with
pointers to objects. llvm-svn: 13909
-rw-r--r--llvm/include/Support/STLExtras.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/Support/STLExtras.h b/llvm/include/Support/STLExtras.h
index 233b7438a4d..961407f5040 100644
--- a/llvm/include/Support/STLExtras.h
+++ b/llvm/include/Support/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:
OpenPOWER on IntegriCloud