Simplify wxSortedArray_SortFunction used in STL build

There is no need to pass the function type as the template parameter as
it's determined by the type of the objects being compared anyhow.
This commit is contained in:
Vadim Zeitlin
2018-05-31 19:33:24 +02:00
parent 3d9d46b754
commit 724409a10c

View File

@@ -95,11 +95,11 @@ private:
CMPFUNC m_f;
};
template<class T, typename F>
template<class T>
class wxSortedArray_SortFunction
{
public:
typedef F CMPFUNC;
typedef int (wxCMPFUNC_CONV *CMPFUNC)(T, T);
wxSortedArray_SortFunction(CMPFUNC f) : m_f(f) { }
bool operator()(const T& i1, const T& i2)
@@ -109,9 +109,7 @@ private:
};
#define _WX_DECLARE_BASEARRAY(T, name, classexp) \
typedef int (wxCMPFUNC_CONV *CMPFUN##name)(T pItem1, T pItem2); \
typedef wxSortedArray_SortFunction<T, CMPFUN##name> name##_Predicate; \
_WX_DECLARE_BASEARRAY_2(T, name, name##_Predicate, classexp)
_WX_DECLARE_BASEARRAY_2(T, name, wxSortedArray_SortFunction<T>, classexp)
#define _WX_DECLARE_BASEARRAY_2(T, name, predicate, classexp) \
class name : public std::vector<T> \