[llvm-commits] [llvm] r78521 - /llvm/trunk/include/llvm/ADT/STLExtras.h
Daniel Dunbar
daniel at zuster.org
Sat Aug 8 20:37:10 PDT 2009
Author: ddunbar
Date: Sat Aug 8 22:36:59 2009
New Revision: 78521
URL: http://llvm.org/viewvc/llvm-project?rev=78521&view=rev
Log:
STLExtras: Add less_ptr.
Modified:
llvm/trunk/include/llvm/ADT/STLExtras.h
Modified: llvm/trunk/include/llvm/ADT/STLExtras.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=78521&r1=78520&r2=78521&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)
+++ llvm/trunk/include/llvm/ADT/STLExtras.h Sat Aug 8 22:36:59 2009
@@ -29,6 +29,13 @@
//===----------------------------------------------------------------------===//
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;
More information about the llvm-commits
mailing list