list<int> foo;
list<int> foo2;
list<int>::iterator foo_end = foo.end();
list<int>::iterator foo2_end = foo2.end();
for (list<int>::iterator it = foo.begin(); it != foo2_end; ++foo) <- notice != comparison here
{
...
Run Code Online (Sandbox Code Playgroud)
这允许吗?它会正常工作吗?
我倾向于认为这是依赖于实现的,任何人都知道标准是否说明了这一点?