In C++ and Java, please try the following things:
create a vecter v1, add some elements in it. Then use a for loop to go through all the elements. By setting up some conditions and make the v1 in a inner loop and remove/add/modify some elements during the inner loop. print out the results.
does the inner loop results affect v1? try some examples.