This is the mail archive of the gcc@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: stl set<T>::iterator == const_iterator?


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


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