From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30728 invoked by alias); 2 May 2006 21:43:25 -0000 Received: (qmail 30714 invoked by uid 48); 2 May 2006 21:43:22 -0000 Date: Tue, 02 May 2006 21:43:00 -0000 Subject: [Bug libstdc++/27404] New: Rope iterators are not InputIterators X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "doug dot gregor at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-05/txt/msg00227.txt.bz2 List-Id: Rope iterators (both const and mutable) do not meet the requirements of an Input Iterator, because their dereference operator only operates on non-const objects. Table 72 of the C++98 Standard requires the valid expression *a, where a is a const iterator, but this valid expression does not work with a non-const operator*. To fix, make operator* and everything it relies on "const". This might have an unfortunate ripple effect; an alternative (but ugly) approach would be to add a new operator* to _Rope_iterator and _Rope_const_iterator that const_cast's and forwards: reference operator*() const { return *const_cast<_Rope_iterator&>(*this); } reference operator*() const { return *const_cast<_Rope_const_iterator&>(*this); } This problem is very unlikely to cause problems in user code, but it makes ConceptGCC sad. -- Summary: Rope iterators are not InputIterators Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: doug dot gregor at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27404