This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: multiset forward iterator is const


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]