首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

linux g++编译器的有关问题

2013-01-07 
linux g++编译器的问题我想使用 stl 的hash_map ..但是他却提示我#include hash_mapusing namespace __g

linux g++编译器的问题
我想使用 stl 的hash_map ..但是他却提示我
#include <hash_map>
using namespace __gnu_cxx;
警告: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]


啥米哦,老旧了? 那使用啥才是不老旧的呢?
[解决办法]

引用:
我想使用 stl 的hash_map ..但是他却提示我
#include <hash_map>
using namespace __gnu_cxx;
警告: #warning This file includes at least one deprecated or antiquated header which may be removed without fu……

这个已经是过去时了,C++11标准未出来前的过渡品.
现在C++11标准里已经定义了hash map.
在头文件<unordered_map>中,命名空间是std;
介绍见:
http://www.cplusplus.com/reference/unordered_map/unordered_map/
linux g++编译时加上选项 -std=c++11即可

热点排行