Index: src/core/SkTSort.h |
=================================================================== |
--- src/core/SkTSort.h (revision 7872) |
+++ src/core/SkTSort.h (working copy) |
@@ -205,4 +205,14 @@ |
SkTQSort(left, right, SkTPointerCompareLT<T>()); |
} |
+/** Adapts an SkTSearch comparison function to a SkTSort functor */ |
reed1
2013/02/26 23:05:44
Why is the functor called COMPARE instead of LT or
bsalomon
2013/02/27 16:56:36
Done, and made the comment a bit more explicit abo
|
+template <typename T, int (COMPARE)(const T*, const T*)> |
+class SkTSearchCompareFunctor { |
+public: |
+ bool operator()(const T& a, const T& b) { |
+ return COMPARE(&a, &b) < 0; |
+ } |
+}; |
+ |
+ |
#endif |