]> git.saurik.com Git - wxWidgets.git/commitdiff
Add missing comparison operator declarations in wxString::iterator.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Oct 2010 19:51:40 +0000 (19:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Oct 2010 19:51:40 +0000 (19:51 +0000)
Fix compilation in !wxUSE_UNICODE_UTF8 case after r65857.

Modify the second declaration of wxString::iterator class which was not
updated by the previous commit in the same way, i.e. add declaration of
comparison operators taking const_iterator to iterator class.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/string.h

index 02cdb6609995381ab4c619d9079714d25c9120e7..32eb250aa9bbcc19864e1dc2796ea96733f3bbc6 100644 (file)
@@ -1098,6 +1098,15 @@ public:
       iterator operator-(ptrdiff_t n) const
         { return iterator(wxStringOperations::AddToIter(m_cur, -n)); }
 
+      // As in UTF-8 case above, define comparison operators taking
+      // const_iterator too.
+      bool operator==(const const_iterator& i) const;
+      bool operator!=(const const_iterator& i) const;
+      bool operator<(const const_iterator& i) const;
+      bool operator>(const const_iterator& i) const;
+      bool operator<=(const const_iterator& i) const;
+      bool operator>=(const const_iterator& i) const;
+
   private:
       // for internal wxString use only:
       iterator(underlying_iterator ptr) : m_cur(ptr) {}
@@ -1125,6 +1134,11 @@ public:
       const_iterator operator-(ptrdiff_t n) const
         { return const_iterator(wxStringOperations::AddToIter(m_cur, -n)); }
 
+      // As in UTF-8 case above, we don't need comparison operators taking
+      // iterator because we have an implicit conversion from iterator to
+      // const_iterator so the operators declared by WX_STR_ITERATOR_IMPL will
+      // be used.
+
   private:
       // for internal wxString use only:
       const_iterator(underlying_iterator ptr) : m_cur(ptr) {}