diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 03:36:59 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-09 03:36:59 +0000 |
commit | 094da67bd781708e76ab37c76e7a87d86404be05 (patch) | |
tree | bef3b60ee24b6645225bd47271265220f4f925e5 | |
parent | 8246bef02aa6ef00242c9f318ecd32ff85d92bc6 (diff) |
STLExtras: Add less_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78521 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/STLExtras.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 964e7e07ef..9ac73c0c96 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -29,6 +29,13 @@ namespace llvm { //===----------------------------------------------------------------------===// 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; + } +}; + +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; |