Thanks CornedBee,
Originally Posted by
CornedBee
References and iterators typically get invalidated at the same time.
Just look at the invalidation rules. Pretty much any operation on a deque invalidates all iterators. With vector, you know that, as long as no reallocation happens, only iterators after the manipulation are invalidated.
1. I can understand iterator will be invalid. But, why reference to deque will be invalid?
For example, suppose you have,
Code:
deque<int> qi;
deque<int>& rqi = qi;
what operation on qi will make the reference rqi invalid?
2.
I am interested in "invalidation rules". But MSDN does not contain much information about it for each API about what will be made invalid after invoking the API. Do you have recommended online documents for that to make quick reference?
regards,
George