Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/159.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 无法访问多重映射迭代器的方法?_C++_Iterator_Multimap - Fatal编程技术网

C++ 无法访问多重映射迭代器的方法?

C++ 无法访问多重映射迭代器的方法?,c++,iterator,multimap,C++,Iterator,Multimap,我不知道出了什么问题,但我无法访问迭代器所引用的对象的方法。这就是我所拥有的: multimap<long, Note>::iterator notesIT; notesIT = trackIT->getNoteList().lower_bound(this->curMsr * 1000000); while(notesIT->first / 1000000 == 1){ cout << notesIT->first.getStartTi

我不知道出了什么问题,但我无法访问迭代器所引用的对象的方法。这就是我所拥有的:

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++;
}
multimap::迭代器notesIT;
notesIT=trackIT->getNoteList()。下限(this->curMsr*1000000);
而(notesIT->first/1000000==1){
cout first.getStartTime()[with _Tp=std::pair]()->std::pair::first',它是非类类型“const long int”
也许:

notesIT->second.getStartTime()
也许:

notesIT->second.getStartTime()

编译器告诉你

notesIT->first.getStartTime()
无效,因为您正试图在
int
上调用
getStartTime()
。显然,您打算在
节点上调用它,因此请选择迭代器指向的对的第二部分(这将生成迭代器的
节点
部分):


cout second.getStartTime()编译器告诉您

notesIT->first.getStartTime()
无效,因为您正试图在
int
上调用
getStartTime()
。显然,您打算在
节点上调用它,因此请选择迭代器指向的对的第二部分(这将生成迭代器的
节点
部分):


cout second.getStartTime()您想要第二个so使用->第二个…提取的错误消息:“请求成员
getStartTime
…在非类类型
const long int
”您想要第二个so使用->第二个…提取的错误消息:“请求成员
getStartTime
…非类类型
const long int
”我应该看到的。谢谢我应该看到的。谢谢