From 7b32639362c4cbb438d71492897d9f84c89d9e57 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Wed, 21 Jul 2004 08:38:06 +0000 Subject: [PATCH] Add greater_ptr functor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15070 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/Support/STLExtras.h | 7 +++++++ include/llvm/ADT/STLExtras.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/include/Support/STLExtras.h b/include/Support/STLExtras.h index 961407f5040..b6379d26232 100644 --- a/include/Support/STLExtras.h +++ b/include/Support/STLExtras.h @@ -60,6 +60,13 @@ struct less_ptr : public std::binary_function { } }; +template +struct greater_ptr : public std::binary_function { + bool operator()(const Ty* left, const Ty* right) const { + return *right < *left; + } +}; + // deleter - Very very very simple method that is used to invoke operator // delete on something. It is used like this: // diff --git a/include/llvm/ADT/STLExtras.h b/include/llvm/ADT/STLExtras.h index 961407f5040..b6379d26232 100644 --- a/include/llvm/ADT/STLExtras.h +++ b/include/llvm/ADT/STLExtras.h @@ -60,6 +60,13 @@ struct less_ptr : public std::binary_function { } }; +template +struct greater_ptr : public std::binary_function { + bool operator()(const Ty* left, const Ty* right) const { + return *right < *left; + } +}; + // deleter - Very very very simple method that is used to invoke operator // delete on something. It is used like this: // -- 2.34.1