diff options
author | Douglas Gregor <dgregor@cs.indiana.edu> | 2006-05-04 09:37:56 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2006-05-04 09:37:56 +0000 |
commit | 49525c762c9bb922808cb334fe181a690ec8811d (patch) | |
tree | 065f6615b2c53fe27161c41d8e15d5ee95830f90 | |
parent | 8cd37d0b6c5eb9e1ac56518f8d7f1257328e96a0 (diff) | |
download | gcc-49525c762c9bb922808cb334fe181a690ec8811d.zip gcc-49525c762c9bb922808cb334fe181a690ec8811d.tar.gz gcc-49525c762c9bb922808cb334fe181a690ec8811d.tar.bz2 |
re PR libstdc++/27404 (Rope iterators are not InputIterators)
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/rope | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2c03608..003e8ef 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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 diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index 35be376..63e9fe9 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -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++() { |