diff options
-rw-r--r-- | llvm/include/llvm/ADT/STLExtras.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 964e7e07ef7..9ac73c0c96c 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/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; |