- hash<const char*> string_hash_;
- const unsigned int seed(
- string_hash_(
- str.c_str()
- )
- );
-#else
- const unsigned int seed(0x3B642879);
- for(int i=0;i<str.size();i++)
+ /* http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1456.html says:
+ *
+ * "Some earlier hash table implementations gave char* special
+ * treatment: it specialized the default hash function to look
+ * at character array being pointed to, rather than the pointer
+ * itself. This proposal removes that special treatment."
+ *
+ * Unfortunately, the older implementation doesn't seem to want to
+ * accept Strings, so we're left with this conditional compilation.
+ */
+# ifdef FUNCTIONAL_HASH_ON_STRING
+ HASH_MAP_NAMESPACE::hash<String> string_hash_;
+ const unsigned int seed(string_hash_(str));
+# else // FUNCTIONAL_HASH_ON_STRING
+ HASH_MAP_NAMESPACE::hash<const char*> string_hash_;
+ const unsigned int seed(string_hash_(str.c_str()));
+# endif // FUNCTIONAL_HASH_ON_STRING
+#else // HASH_MAP_H
+ unsigned int seed(0x3B642879);
+ for(unsigned int i=0;i<str.size();i++)