From 1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 30 May 2004 07:45:09 +0000 Subject: 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 --- include/llvm/ADT/STLExtras.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/llvm/ADT') diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 233b743..961407f 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -53,6 +53,12 @@ struct bitwise_or : public std::binary_function { } }; +template +struct less_ptr : public std::binary_function { + 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: -- cgit v1.1