This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ 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


> 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

This code, which differs from yours, compiles without warning with the 
v-3 release (which is not the same as 2.90, and is the expressed subject 
of  this list.)

#include <set>

int main(void)
{
  typedef  multiset<int, less<int> > multiset_type;
  multiset_type x;
  x.insert(5);
  multiset_type::iterator iter = x.begin();
  multiset_type::reference y = *iter;
}





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