为什么这个std :: map代码不起作用? [英] Why is this std::map code not working?

查看:55
本文介绍了为什么这个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代码不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆