title: Re-using iterator after 'insert' into vector
body: <p>I need some clarification regarding vector and iterator.  I have a vector of <code>my_object</code>, and an iterator for that vector. I perform an insert at the iterator position, and a second insert at the same location:</p>
  
  <pre><code>myiteratornew = (my_vector).insert(myiterator, my_object1);
  myiteratornew = (my_vector).insert(myiterator, my_object2);
  </code></pre>
  
  <p>After using several times this function on several kind of 'input' data, today I get a memory error.  Of course I think the problem is caused by the use of the <em>old</em> iterator on the <em>modified</em> (reallocated) vector; modifying the code this way now it works:</p>
  
  <pre><code>myiteratornew = (my_vector).insert(myiterator, my_object1);
  myiteratornew = (my_vector).insert(myiteratornew , my_object2);
  </code></pre>
  
  <p>My question is, how is it possible that I used my code several times without getting the memory error?  Should the second code prevent my code causing a memory error?</p>