Check this code:
#include \"stdafx.h\"
#include
int _tmain(int argc, _TCHAR* argv[])
{
std::list mylist;
mylist.push_back(1);
This is in fact invalid. Iterators are only valid on the current state container. Once you add or remove items, the iterator is no longer valid.
The article you link does not say what you are doing is valid. They get a new iterator after the clear.
The reason it doesn't show up in release code is because the debugging that picks up the issue is disabled.