is the behavior for changing a hashmap as we iterate over it, defined? <p>Is it okay in C++ with STL to change a hashmap while iterating over it?</p> <p>obviously, you can change the iterator variable itself (iter->first and iter->second), but can you:</p> <ol> <li><p>change the value of an existing key which is not necessarily pointed to by the iterator?</p></li> <li><p>add new keys?</p></li> </ol>