检查此代码:
#include "stdafx.h"
#include <list>
int _tmain(int argc, _TCHAR* argv[])
{
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;
}
现在,根据cplusplus.com的说法,这应该不是问题,在发布模式下,我认为这很好,不会引起任何问题,但调试变得不可能,因为这只是让我继续下去。任何指针?