struct hash< std::basic_string<CharT, Traits, Alloc> > {
size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
struct hash< std::basic_string<CharT, Traits, Alloc> > {
size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const {
- const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(std::locale());
-
- return c.hash(s.c_str(), s.c_str() + s.size());
+ size_t hash = 0;
+ for (unsigned int i = 0; i < s.size(); ++i)
+ hash += static_cast<size_t>(s[i]);
+ return hash + s.size();
- const std::collate<CharT>& c = std::use_facet< std::collate<CharT> >(std::locale());
-
- return c.hash(s.c_str(), s.c_str() + s.size());
+ size_t hash = 0;
+ for (unsigned int i = 0; i < s.size(); ++i)
+ hash += static_cast<size_t>(s[i]);
+ return hash + s.size();