re PR libstdc++/27404 (Rope iterators are not InputIterators)
authorDouglas Gregor <dgregor@cs.indiana.edu>
Thu, 4 May 2006 09:37:56 +0000 (09:37 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 4 May 2006 09:37:56 +0000 (09:37 +0000)
2006-05-04  Douglas Gregor  <dgregor@cs.indiana.edu>

PR libstdc++/27404
* include/ext/rope (_Rope_const_iterator<>::operator*() const,
_Rope_iterator<>::operator*() const): Add.

From-SVN: r113519

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/rope

index 2c03608cc6474c01377f1a9d1c626ee989c3a75c..003e8ef165c9efb1aaa2e2ada319bfb0a33cc887 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-04  Douglas Gregor  <dgregor@cs.indiana.edu>
+
+       PR libstdc++/27404
+       * include/ext/rope (_Rope_const_iterator<>::operator*() const,
+       _Rope_iterator<>::operator*() const): Add.
+
 2006-05-01  Paolo Carlini  <pcarlini@suse.de>
 
        * acinclude.m4 (GLIBCXX_ENABLE_WCHAR_T): Always check the
index 35be37687a54ecbc76e01e0bcd063ddc030fef55..63e9fe9661fcea323817714b8386f2eee949788d 100644 (file)
@@ -1153,7 +1153,15 @@ protected:
          _S_setcache(*this);
         return *this->_M_buf_ptr;
       }
-      
+
+      // Without this const version, Rope iterators do not meet the
+      // requirements of an Input Iterator.
+      reference
+      operator*() const
+      {
+       return *const_cast<_Rope_const_iterator&>(*this);
+      }
+
       _Rope_const_iterator&
       operator++()
       {
@@ -1336,6 +1344,13 @@ protected:
                                                      *this->_M_buf_ptr);
       }
 
+      // See above comment.
+      reference
+      operator*() const
+      {
+       return *const_cast<_Rope_iterator&>(*this);
+      }
+
       _Rope_iterator&
       operator++()
       {