fork(1) download
  1. #include <string>
  2. #include <map>
  3. #include <unordered_map>
  4.  
  5. using namespace std;
  6.  
  7. namespace std
  8. {
  9. template <>
  10. struct hash<const string>
  11. {
  12. typedef size_t result_type;
  13. typedef const string argument_type;
  14.  
  15. size_t operator () (const string& k) const
  16. {
  17. return hash<string>()(k);
  18. }
  19. };
  20.  
  21. }
  22.  
  23. int main(void)
  24. {
  25. unordered_map<const string, int> m1;
  26. unordered_map<const string, int, hash<string>> m2;
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty