I want to declare :
std::unordered_map m_mapMyMap;
But when I build I got an error telling me that the standard C++
std::unordered_map use std::hash<> that does not use (LPCSTR) operator.
You need to redefine hash function:
template class MyHash;
template<>
class MyHash {
public:
size_t operator()(const CString &s) const
{
return std::hash()( (LPCSTR)s );
}
};
std::unordered_map m_mapMyMap;
But for better performance use std::string instead CString for key.