multiset forward iterator is const

Benjamin Kosnik bkoz@cygnus.com
Wed Nov 10 11:38:00 GMT 1999


> 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;
}






More information about the Libstdc++ mailing list