This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/27404
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 04 May 2006 11:39:53 +0200
- Subject: [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++()
{