Title
Forward iterator requirements don't allow constant iterators
Status
cd1
Section
[forward.iterators]
Submitter
Matt Austern

Created on 1999-11-19.00:00:00 last changed 163 months ago

Messages

Date: 2010-10-21.18:28:33

[ Redmond: the LWG thinks this is separable from other constness issues. This issue is just cleanup; it clarifies language that was written before we had iterator_traits. Proposed resolution was modified: the original version only discussed *a. It was pointed out that we also need to worry about *r++ and a->m. ]

Date: 2010-10-21.18:28:33

[ Tokyo: The LWG believes this is the tip of a larger iceberg; there are multiple const problems with the STL portion of the library and that these should be addressed as a single package.  Note that issue 180 has already been declared NAD Future for that very reason. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

In table 74, in the *a and *r++ rows, change the return type from "T&" to "T& if X is mutable, otherwise const T&". In the a->m row, change the return type from "U&" to "U& if X is mutable, otherwise const U&".

Date: 1999-11-19.00:00:00

In table 74, the return type of the expression *a is given as T&, where T is the iterator's value type. For constant iterators, however, this is wrong. ("Value type" is never defined very precisely, but it is clear that the value type of, say, std::list<int>::const_iterator is supposed to be int, not const int.)

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1837
2010-10-21 18:28:33adminsetmessages: + msg1836
2010-10-21 18:28:33adminsetmessages: + msg1835
1999-11-19 00:00:00admincreate