#include <list>
#include <stdio.h>
int main()
{
std::list<int> mylist;
mylist.push_back(1);
std::list<int>::iterator i = mylist.end();
if( i == mylist.end() )
printf( "end is end\n" );
mylist.clear();
if( i == mylist.end() )
printf( "never get here because Microsoft seems to think the iterator is no longer safe.\n" );
return 0;
}
I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxzdGRpby5oPgoKaW50IG1haW4oKQp7CiAgICBzdGQ6Omxpc3Q8aW50PiBteWxpc3Q7CiAgICBteWxpc3QucHVzaF9iYWNrKDEpOwogICAgc3RkOjpsaXN0PGludD46Oml0ZXJhdG9yIGkgPSBteWxpc3QuZW5kKCk7CiAgICBpZiggaSA9PSBteWxpc3QuZW5kKCkgKQogICAgICAgIHByaW50ZiggImVuZCBpcyBlbmRcbiIgKTsKCiAgICBteWxpc3QuY2xlYXIoKTsKICAgIGlmKCBpID09IG15bGlzdC5lbmQoKSApCiAgICAgICAgcHJpbnRmKCAibmV2ZXIgZ2V0IGhlcmUgYmVjYXVzZSBNaWNyb3NvZnQgc2VlbXMgdG8gdGhpbmsgdGhlIGl0ZXJhdG9yIGlzIG5vIGxvbmdlciBzYWZlLlxuIiApOwoKICAgIHJldHVybiAwOwp9Cg==