【发布时间】:2010-02-26 23:50:03
【问题描述】:
我有这样运行的东西:
T baseline;
list<T>::const_iterator it = mylist.begin();
while (it != mylist.end()) {
if (it == baseline) /* <----- This is what I want to make happen */
// do stuff
}
我的问题是我不知道如何从迭代器中提取数据。我觉得这是一件很愚蠢的事情,但我不知道该怎么做。
编辑:修复 begin.end()
【问题讨论】:
-
你的
while有问题:使用mylist.end()。