我有一些像这样运行的东西:
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
}
Run Code Online (Sandbox Code Playgroud)
我的问题是我不知道如何从迭代器中提取数据.我觉得这是一个令人困惑的愚蠢的事情,但我不知道该怎么做.
编辑:修复了begin.end()