Change return type of wxList::Member() to bool.

It used to return a pointer in wxUSE_STL==0 build and an object in
wxUSE_STL==1 one making checking its return value difficult without provoking
warnings from either MSVC or g++ (see #11038).

Also, all the other occurrences of Member() already returned bool, including
the one in wxStringList so changing it to return bool in wxList itself is more
consistent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-09-18 17:10:58 +00:00
parent 29106845fc
commit 0f08aa4432
4 changed files with 13 additions and 10 deletions

View File

@@ -258,7 +258,7 @@ inline const void *wxListCastElementToVoidPtr(const wxString& str)
iterator i = const_cast< liT* >(this)->end(); \
return compatibility_iterator( this, !empty() ? --i : i ); \
} \
compatibility_iterator Member( elT e ) const \
bool Member( elT e ) const \
{ return Find( e ); } \
compatibility_iterator Nth( int n ) const \
{ return Item( n ); } \
@@ -1179,12 +1179,8 @@ public:
// compatibility methods
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
#endif
#if wxUSE_STL
#else
wxNode *Member(wxObject *object) const { return (wxNode *)Find(object); }
#endif
bool Member(wxObject *object) const { return Find(object) != NULL; }
#endif // !wxUSE_STL
};
#if !wxUSE_STL