我不知道出了什么问题,但我无法访问我的迭代器所指的对象的方法。这就是我所拥有的:
multimap<long, Note>::iterator notesIT;
notesIT = trackIT->getNoteList().lower_bound(this->curMsr * 1000000);
while(notesIT->first / 1000000 == 1){
cout << notesIT->first.getStartTime() << endl; // error on this line
notesIT++;
}
我收到此错误:
error: request for member 'getStartTime' in 'notesIT. std::_Rb_tree_iterator<_Tp>::operator-> [with _Tp = std::pair<const long int, Note>]()->std::pair<const long int, Note>::first', which is of non-class type 'const long int'