title: Does inserting/erasing an element from a std::map modify the iteration sequence?
body: <p>Say I have the following code:</p>
  
  <pre><code>typedef std::map&lt; int, std::string &gt;::iterator Iterator;
  Iterator iter = myMap.begin();
  
  while (iter != myMap.end())
  {
      Iterator current = iter;
      ++iter;
  
      maybeDeleteElement( current ) // may call erase.
  }
  </code></pre>
  
  <p>Given that <code>std::map</code> is implemented as a red-black tree, is it guaranteed that every element in the map will be visited exactly once? Or will modifying the map cause the tree to rebalance, and thus the iteration sequence to change?</p>
  
  <p>Note: This is not a question about whether or not any iterators will be invalidated. But an iterator remaining valid does not necessarily mean that incrementing it will give you the same next element that it did before.</p>