Use correct types for comparison functions in wxArray,

wxSortedArray and wxSortedArrayString, when wxUSE_STL=1.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2003-07-17 22:23:43 +00:00
parent bf07249cdd
commit f700f98cf5
3 changed files with 46 additions and 18 deletions

View File

@@ -90,17 +90,17 @@ size_t name::Add(T lItem, CMPFUNC fnCompare) \
#define _WX_DEFINE_BASEARRAY_NOCOMMON(T, name) \
size_t name::IndexForInsert(T lItem, CMPFUNC fnCompare) const \
{ \
Predicate p(fnCompare); \
Predicate p((SCMPFUNC)fnCompare); \
const_iterator it = std::lower_bound(begin(), end(), lItem, p); \
return it - begin(); \
} \
\
int name::Index(T lItem, CMPFUNC fnCompare) const \
{ \
size_t n = IndexForInsert(lItem, fnCompare); \
\
return (n >= size() || \
(*fnCompare)(&lItem, &(*this)[n])) ? wxNOT_FOUND : (int)n; \
Predicate p((SCMPFUNC)fnCompare); \
const_iterator it = std::lower_bound(begin(), end(), lItem, p); \
return (it != end() && \
p(lItem, *it)) ? (int)(it - begin()) : wxNOT_FOUND; \
} \
\
void name::Shrink() \