本文介绍了为什么这个std :: map代码不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用typename后,我的迭代器编译器无法识别 - > second.get。为什么
after using typename for my iterator compiler couldn't recognise ->second.get. Why
typename std::map<K,V>::iterator p;
template<class K, class V>
/////////////////////////////
////////////////////////////
p = mymap.find(Key);
if(p != mymap.end())
{
if(p->second.get() == val)//Compiler couldn't //recoginise get hy
{
throw 'a';//Value type cannot match value for previous key
}
}
我的尝试:
我花了整整一天在谷歌上面。
What I have tried:
I have spent the whole day on google over.
推荐答案
这篇关于为什么这个std :: map代码不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!