我不知道什麼是錯的,但我不能訪問我的迭代器所指的對象的方法。這是我有:無法訪問multimap迭代器的方法?
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'
您希望第二個這樣使用 - >第二。 .. – 2012-04-16 00:10:13
Distilled錯誤消息:「請求成員'getStartTime' ...在非類類型'常量長整型'」 – 2012-04-16 00:11:16