+template<class T>
+class WXDLLIMPEXP_BASE wxArray_SortFunction
+{
+public:
+ typedef int (wxCMPFUNC_CONV *CMPFUNC)(T* pItem1, T* pItem2);
+
+ wxArray_SortFunction(CMPFUNC f) : m_f(f) { }
+ bool operator()(const T& i1, const T& i2)
+ { return m_f((T*)&i1, (T*)&i2) < 0; }
+private:
+ CMPFUNC m_f;
+};
+
+template<class T, typename F>
+class WXDLLIMPEXP_BASE wxSortedArray_SortFunction
+{
+public:
+ typedef F CMPFUNC;
+
+ wxSortedArray_SortFunction(CMPFUNC f) : m_f(f) { }
+ bool operator()(const T& i1, const T& i2)
+ { return m_f(i1, i2) < 0; }
+private:
+ CMPFUNC m_f;
+};
+