This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: stl set<T>::iterator == const_iterator?
- To: Martin Woudstra <Martin dot Woudstra at cern dot ch>
- Subject: Re: stl set<T>::iterator == const_iterator?
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 22 Jul 2001 10:28:49 -0300
- Cc: gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <3B557BC1.A9C3F941@cern.ch>
On Jul 18, 2001, Martin Woudstra <Martin.Woudstra@cern.ch> wrote:
> This means that I can not call any non-const member functions
> of objects in a set<> using iterators.
Yep. Modifying the state of a member of the set might require it to
be moved in the rbtree. There's no provision for this in the Standard.
> The strange thing is that in STL map<> a normal non-const iterator
> IS defined
Yep, but you still can't change the key, only the value it maps to.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me