There\'s been some debate going on in this question about whether the following code is legal C++:
std::list- ::iterator i = items.begin();
while
Sutter's Guru of the Week #55 (and the corresponding piece in "More Exceptional C++") discusses this exact case as an example.
According to him, it is perfectly valid code, and in fact a case where trying to transform the statement into two lines:
items.erase(i); i++;
does not produce code that is semantically equivalent to the original statement.