我在UbuntuC++ unordered_map编译问题与G ++
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
使用G ++我有这样的代码
#include<unordered_map>
using namespace std;
bool ifunique(char *s){
unordered_map<char,bool> h;
if(s== NULL){
return true;
}
while(*s){
if(h.find(*s) != h.end()){
return false;
}
h.insert(*s,true);
s++;
}
return false;
}
当我编译使用
g++ mycode.cc
我有错误
error: 'unordered_map' was not declared in this scope
我错过了什么吗?
错误:调用“STD没有匹配功能: :unordered_map,std :: equal_to ,std :: allocator >>插入(char&,bool)' –
icn
2010-10-19 23:47:06
@xlione:Can你向我们展示代码?好像你正试图在你的地图中插入一个引用类型。 – birryree 2010-10-19 23:48:32
更新,谢谢 – icn 2010-10-19 23:51:03