This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: multiset forward iterator is const
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: multiset forward iterator is const
- From: Ross Smith <ross dot s at ihug dot co dot nz>
- Date: Fri, 22 Oct 1999 19:26:28 +1300
- Organization: The Internet Group
- References: <14351.64591.662915.505667@bolero>
Matthias Klose wrote:
>
> "The Dec 2, 1996 draft of the "Working Paper for Draft Proposed
> International Standard for Information Systems Programming Language
> C++" says that the multiset must support forward iterators. A forward
> iterator's operator* must return a reference (T&). The implementation
> in libstdc++2.9-dev multiset.h returns a const reference (const T&).
> This is not correct."
The standard's description of forward iterators places no constraints,
as far as I can see, on T. Operator* must return a reference to some
type, but there's no requirement that the type must not be const. In
this case, T is const int, which seems perfectly legal.
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"There are many technical details that make Linux attractive to the
sort of people to whom technical details are attractive." -- Suck