C++ unordered_map with char* as key
问题 I feel exhausted when trying to use the container unordered_map with char* as the key (on Windows, I am using VS 2010). I know that I have to define my own compare function for char* , which inherits from binary_function . The following is a sample program. #include<unordered_map> #include <iostream> #include <string> using namespace std; template <class _Tp> struct my_equal_to : public binary_function<_Tp, _Tp, bool> { bool operator()(const _Tp& __x, const _Tp& __y) const { return strcmp( _