Topic: map iterators and insert


Author: "Brad Daniels" <brad.daniels@missioncritical.com>
Date: 1997/11/13
Raw View
Is the following sequence on a map m of type M legal for all keys k1 and k2?

M::iterator iter = m.find(k1);
m.insert(k2);
m.erase(iter);

In my actual code, I save the iterator returned from an insertion operation,
then go into a wait, during which an arbitrary number of insertions and
deletions may occur.  I can't find anything in the draft standard one way or
the other.

- Brad
--
----------------------------------------------------------------------------
Brad Daniels                  |  Was mich nicht umbringt macht mich hungrig.
Mission Critical Software     |   - Otto Nietzche
Standard disclaimers apply    |     (Friedrich's corpulent brother)
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]