From 22d080f35b173d2a855078d11e6b142b4e6d79a7 Mon Sep 17 00:00:00 2001 From: Dimitri Schoolwerth Date: Thu, 15 Apr 2004 11:05:13 +0000 Subject: [PATCH] improved const-ness of find/Find functions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26781 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/list.h | 8 ++++---- src/common/list.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/list.h b/include/wx/list.h index 2312ea4908..6be233d821 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -157,7 +157,7 @@ enum wxKeyType dummy(); \ }; \ protected: \ - iterator find( elT e ) \ + iterator find( const elT e ) \ { \ iterator it, en; \ for( it = begin(), en = end(); it != en; ++it ) \ @@ -188,7 +188,7 @@ enum wxKeyType { \ erase( it.m_iter ); \ } \ - citer Find( elT e ) const { return citer( this, ((liT*)this)->find( e ) ); } \ + citer Find( const elT e ) const { return citer( this, ((liT*)this)->find( e ) ); } \ citer Member( elT e ) const { return Find( e ); } \ citer Insert( elT e ) \ { push_front( e ); return citer( this, begin() ); } \ @@ -497,7 +497,7 @@ protected: // search (all return NULL if item not found) // by data - wxNodeBase *Find(void *object) const; + wxNodeBase *Find(const void *object) const; // by key wxNodeBase *Find(const wxListKey& key) const; @@ -647,7 +647,7 @@ private: void Erase(compatibility_iterator it) \ { DeleteNode(it); } \ \ - nodetype *Find(Tbase *object) const \ + nodetype *Find(const Tbase *object) const \ { return (nodetype *)wxListBase::Find(object); } \ \ virtual nodetype *Find(const wxListKey& key) const \ diff --git a/src/common/list.cpp b/src/common/list.cpp index 26ace46fb5..e51c364021 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -345,7 +345,7 @@ wxNodeBase *wxListBase::Find(const wxListKey& key) const return (wxNodeBase *)NULL; } -wxNodeBase *wxListBase::Find(void *object) const +wxNodeBase *wxListBase::Find(const void *object) const { for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) { -- 2.45.2