Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. typedef tr1::unordered_map hashmap;
  2. typedef map hashmap;
  3.  
  4. map<string, string>
  5. map<string, int>
  6. map <string, map<string,int>> ..etc
  7.  
  8. template <typename Key, typename T>
  9. struct hashmap {
  10. typedef std::unordered_map<Key, T> type;
  11. // or
  12. //typedef std::map<Key, T> type;
  13. };
  14.  
  15. hashmap<int, float>::type some_map;
  16.  
  17. template <typename T1, typename T2>
  18. struct hashmap
  19. {
  20. typedef std::map<T1, T2> type;
  21. };
  22.  
  23. #ifdef HAVE_TR1
  24. #include <tr1/unordered_map>
  25. #define HASH_MAP std::tr1::unordered_map
  26. #else
  27. #include <map>
  28. #define HASH_MAP std::map
  29. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement