diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-05-30 07:45:09 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-05-30 07:45:09 +0000 |
commit | 1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3 (patch) | |
tree | 8270002e01ac2d7a63df83b17a3be8e2c9969226 /include/llvm/ADT | |
parent | f561b08d67788e4570529b13938b65f097b2ac52 (diff) | |
download | external_llvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.zip external_llvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.tar.gz external_llvm-1da7e8e0b3cfc1d3c399da4cdd7dc5c087c9f0d3.tar.bz2 |
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')
-rw-r--r-- | include/llvm/ADT/STLExtras.h | 6 |
1 files changed, 6 insertions, 0 deletions
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<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: |