Sto usando g ++ in UbuntuC++ unordered_map compilazione problema con g ++
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Ho questo codice
#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;
}
Quando compilo usando
g++ mycode.cc
ho ottenuto l'errore
error: 'unordered_map' was not declared in this scope
Mi manca qualcosa?
errore: nessuna funzione di corrispondenza per chiamata a 'std: : unordered_map, std :: equal_to , std :: allocator >> :: insert (char &, bool) ' –
icn
@xlione: Can ci mostri il codice? Sembra che tu stia cercando di inserire un tipo di riferimento nella tua mappa. – birryree
aggiornato, grazie risolto il problema – icn