I am not aruging that a vector class may do that (I am not sure what vector implementation you are referencing), but that isn't the set standard (is is undefined)!!!
But at this web site:
http://www.csci.csusb.edu/dick/c++std/c ... lib.vector
section 23.4.2.3
You will find it talk about erase(), and that it invalides any iterators outstanding beyond that location.
Now, lets ensure we are discussing the same thing. I am saying that any iterator you have after a erase is invalid. NOT the one returned by the operation (that is the next one or the end(), and tha is true for vector and deque).
So not sure which we are talking about.
If the first (not the return value) then you are counting on behavior that is not the specification(which I guess isn't a good reason in your mind).
So regardless of what Stanford or others do, you are counting on a specific behavior.
The standard is for vector and deque to be the same for usage (I only mention it to check errors).
I am fine with UOX3 coding to behavior that works, but not the standard (again, perahaps an updated standard has been released, I coudn't find it). But to say to that vectors do something , if it isn't ina standard, it shouldn't be generalized, but referenced to a specific implementation.
Recognize that as one goes to other STL implemntations , it may not work.