假设我使用嵌套来比较同一列表中的对象:
for( list<Object>::iterator iter = list.begin() ; iter != list.end() ; ++iter )
{
for( list<Object>::iterator iter2 = list.begin() ; iter2 != list.end() ; ++iter2 )
{
if( iter == iter2 )
{
// does this mean iter is pointing to the same INDEX
// as iter2? Will this work as expected?
}
}
}
Run Code Online (Sandbox Code Playgroud)