[llvm-commits] CVS: llvm/include/llvm/ADT/HashExtras.h

Chris Lattner lattner at cs.uiuc.edu
Wed Dec 8 12:59:32 PST 2004



Changes in directory llvm/include/llvm/ADT:

HashExtras.h updated: 1.11 -> 1.12
---
Log message:

Define the pointer hash struct before the string one, to improve compatibility
with ICC.  Patch contributed by Bjørn Wennberg.


---
Diffs of the changes:  (+6 -6)

Index: llvm/include/llvm/ADT/HashExtras.h
diff -u llvm/include/llvm/ADT/HashExtras.h:1.11 llvm/include/llvm/ADT/HashExtras.h:1.12
--- llvm/include/llvm/ADT/HashExtras.h:1.11	Wed Sep  1 17:55:34 2004
+++ llvm/include/llvm/ADT/HashExtras.h	Wed Dec  8 14:59:18 2004
@@ -23,12 +23,6 @@
 // Cannot specialize hash template from outside of the std namespace.
 namespace HASH_NAMESPACE {
 
-template <> struct hash<std::string> {
-  size_t operator()(std::string const &str) const {
-    return hash<char const *>()(str.c_str());
-  }
-};
-
 // Provide a hash function for arbitrary pointers...
 template <class T> struct hash<T *> {
   inline size_t operator()(const T *Val) const {
@@ -36,6 +30,12 @@
   }
 };
 
+template <> struct hash<std::string> {
+  size_t operator()(std::string const &str) const {
+    return hash<char const *>()(str.c_str());
+  }
+};
+
 }  // End namespace std
 
 #endif






More information about the llvm-commits mailing list