I was hoping maybe someone could help me solve my issue. I get a lovely
No matching function for call to object of type 'const pCompare'
struct pCompare { bool operator()( const std::string & str1, const std::string & str2 ) const { return str1.compare( str2 ) == 0; } }; std::string *t = new std::string ( "/test.html" ); std::map<std::string*, std::string, pCompare> test; test.insert ( std::pair<std::string*, std::string> ( t, "héhé" ) ); std::cout << test.find(new std::string ("/test.html") )->second; Thanks for your help !
(const) string *as keys yet your comparator takesconst string &...std::map<std::string, std::string>. Using values instead of pointers can make things a lot easier.