From: Vadim Zeitlin Date: Tue, 21 Mar 2006 13:14:19 +0000 (+0000) Subject: added assert to verify that operands are initialized in compatibility_iterator::opera... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b4affacc1059659eb3772240ee3517df44fb6a44 added assert to verify that operands are initialized in compatibility_iterator::operator==() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/list.h b/include/wx/list.h index 8499b8a94f..7d1f0ebc1a 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -166,7 +166,11 @@ private: const compatibility_iterator* operator->() const { return this; } \ \ bool operator==(const compatibility_iterator& i) const \ - { return (m_list == i.m_list) && (m_iter == i.m_iter); } \ + { \ + wxASSERT_MSG( m_list && i.m_list, \ + _T("comparing invalid iterators is illegal") ); \ + return (m_list == i.m_list) && (m_iter == i.m_iter); \ + } \ bool operator!=(const compatibility_iterator& i) const \ { return !( operator==( i ) ); } \ operator bool() const \