"Ron Natalie" <> wrote in message
news:43711727$0$9524$ ...
> Nan Li wrote:
>> But I was wondering if this form is safe, in the strictest sense.
>> The underlying question is ' does remove guarantee that the end()
>> iterator is still valid after the operation' ?
> There is no guarantee on the order of execution, but none is required.
> The moving around of items in the sequence can't do anything that
> would invalidate the end() iterator since it's not evaluated at all
> during the execution of remove (it's passed in as an argument).
This is a good one to remember the next time you're looking for an interview
question