This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] libstdc++/27404


Hi,

tested x86-linux, committed to mainline.

Paolo.

////////////////
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.
Index: include/ext/rope
===================================================================
--- include/ext/rope	(revision 113498)
+++ include/ext/rope	(working copy)
@@ -1153,7 +1153,15 @@
 	  _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 @@
 						      *this->_M_buf_ptr);
       }
 
+      // See above comment.
+      reference
+      operator*() const
+      {
+	return *const_cast<_Rope_iterator&>(*this);
+      }
+
       _Rope_iterator&
       operator++()
       {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]