From 724409a10cc261a2a25e44f72ee8f13c60b131de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 31 May 2018 19:33:24 +0200 Subject: [PATCH] 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. --- include/wx/dynarray.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index a15936c394..1b5f86e1f9 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -95,11 +95,11 @@ private: CMPFUNC m_f; }; -template +template 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 name##_Predicate; \ - _WX_DECLARE_BASEARRAY_2(T, name, name##_Predicate, classexp) + _WX_DECLARE_BASEARRAY_2(T, name, wxSortedArray_SortFunction, classexp) #define _WX_DECLARE_BASEARRAY_2(T, name, predicate, classexp) \ class name : public std::vector \