如何摆脱g ++ hash_map弃用警告? [英] How to get rid of g++ hash_map deprecation warning?

查看:487
本文介绍了如何摆脱g ++ hash_map弃用警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译一个c ++应用程序时,我写的使用hash_map,我得到这个警告g ++ 4.3.2:

When I compile a c++ application I'm writing that makes use of hash_map, I get this warning on g++ 4.3.2:

您使用的是已弃用的头。要消除此警告,请使用ANSI标准头文件或使用hte -Wno-deprecated编译器标志。

You are using the deprecated header . To eliminate this warning, use an ANSI-standard header file or use hte -Wno-deprecated compiler flag.

9> #include <ext/hash_map>

包括什么替换?我在google上搜索了一段时间,除了有类似问题但没有解决方法的人找不到任何东西。

What include replaces this? I've searched for a while on google, and can't find anything except for people having similar problems, but no solution.

推荐答案

p>我的第一个Google匹配 g ++ hash_map已弃用使我访问页面,其中包含一系列事件

My very first Google hit for "g++ hash_map deprecated" takes me to a page that includes a list of things to use instead of the deprecated headers and classes.

对于 hash_map ,列表建议使用 unordered_map ,在 unordered_map 头。此课程是 TR1 的新课程。

For hash_map, the list suggests using unordered_map, in the unordered_map header. The class is new for TR1.

这篇关于如何摆脱g ++ hash_map弃用警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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