【发布时间】:2011-04-22 13:52:46
【问题描述】:
std::vector<string> names;
std::vector<string>::iterator start = names.begin();
std::vector<string>::iterator end = names.end();
sort (start,end);
//are my start and end valid at this point?
//or they do not point to front and tail resp?
【问题讨论】:
-
我认为应该是
std::vector<string>::iterator start? -
即使这是真的,追随你的开发者也会浪费一天的时间来证明这是他正在修复的一些错误的根本原因......
-
@Ben,谢谢,抱歉复制粘贴邪恶!
-
只是为了记录,您在这里寻找的词是“无效”。 :)
-
为什么是哈哈哈?我只是想您可能想知道,因为它使将来谷歌搜索变得更加容易。 (迭代器失效是大多数 C++ 程序员都熟悉的术语,虽然大多数人可能会猜到您所说的迭代器“被破坏”是什么意思,但它可能不会在 Google 中产生那么多的搜索结果。)