From: Alkis Evlogimenos Date: Wed, 21 Jul 2004 08:38:06 +0000 (+0000) Subject: Add greater_ptr functor. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b32639362c4cbb438d71492897d9f84c89d9e57;p=oota-llvm.git Add greater_ptr functor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15070 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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: //