C++ deque: when iterators are invalidated
push_back() and push_front() are defined in terms of insert(). Similarly, pop_back() and pop_front() are defined in terms of erase(). Here’s what the C++03 standard says about iterator invalidation for insert() (23.2.1.3/1): An insert in the middle of the deque invalidates all the iterators and references to elements of the deque. An insert at either end … Read more