相关疑难解决方法(0)

如何从STL的const_iterator中获取数据?

我有一些像这样运行的东西:

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()

c++ iterator stl

4
推荐指数
1
解决办法
6784
查看次数

标签 统计

c++ ×1

iterator ×1

stl ×1