小编aaf*_*foo的帖子

比较两个end()迭代器

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)

这允许吗?它会正常工作吗?

我倾向于认为这是依赖于实现的,任何人都知道标准是否说明了这一点?

c++ iterator stl

3
推荐指数
1
解决办法
571
查看次数

标签 统计

c++ ×1

iterator ×1

stl ×1