diff options
Diffstat (limited to 'gold/gold.h')
-rw-r--r-- | gold/gold.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gold/gold.h b/gold/gold.h index 20095eb..03737a2 100644 --- a/gold/gold.h +++ b/gold/gold.h @@ -39,10 +39,32 @@ #include <ext/hash_map> #include <ext/hash_set> +#include <string> #define Unordered_set __gnu_cxx::hash_set #define Unordered_map __gnu_cxx::hash_map +namespace __gnu_cxx +{ + +template<> +struct hash<std::string> +{ + size_t + operator()(std::string s) const + { return __stl_hash_string(s.c_str()); } +}; + +template<typename T> +struct hash<T*> +{ + size_t + operator()(T* p) const + { return reinterpret_cast<size_t>(p); } +}; + +} + #else // The fallback is to just use set and map. |