This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: multiset forward iterator is const
- To: Matthias Klose <doko at cs dot tu-berlin dot de>
- Subject: Re: multiset forward iterator is const
- From: Benjamin Kosnik <bkoz at cygnus dot com>
- Date: Wed, 10 Nov 1999 11:38:30 -0800 (PST)
- cc: libstdc++ at sourceware dot cygnus dot com, 36600 at bugs dot debian dot org, David Marwood <marwood at infranetsolutions dot com>
> 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;
}