Remove unnecessary and broken hash specializations
Summary: No need to specialize std::hash for std::basic_string; the STL already does this. Plus, the specializations were broken in multiple ways: 1. std::hash does not treat const char* specially, so it just hashes the pointer value (contrasting the old __gnu_cxx::hash, which hashed a C-string) 2. Either way, using __gnu_cxx::hash<const char*> for std::string is broken, as it won't hash anything past the first null byte. Also, make sure fbstring gets the same (full) specializations as std::string does in the standard. Test Plan: fbconfig -r folly && fbmake runtests_opt, also tests in tupperware/agent which is still using __gnu_cxx::hash_map with string keys. Reviewed By: pgriess@fb.com, andrei.alexandrescu@fb.com Subscribers: njormrod, jhj, kma, lesha FB internal diff: D1426479
Showing
Please register or sign in to comment