【发布时间】:2013-05-19 02:02:01
【问题描述】:
据我了解,以下程序
#include <map>
int main()
{
std::map<int,int> foo;
std::map<int,int>::iterator start = foo.begin();
while (start++ != foo.end())
;
}
应该终止,但它会使用 libstdc++ 4.7.2 无限循环。该程序表现出的行为是否正确,或者标准库中是否存在错误? operator++(int) 在迭代器上的操作属性是什么?
【问题讨论】: