diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-08 20:59:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-08 20:59:18 +0000 |
commit | 3e4445cd0360bf81533df61e8cec0880a09142f0 (patch) | |
tree | 00fe947a24dc2101df9c0dfb564a23e7779cda54 | |
parent | 64307720356880d42295f41f95c77bb3416a6468 (diff) | |
download | bcm5719-llvm-3e4445cd0360bf81533df61e8cec0880a09142f0.tar.gz bcm5719-llvm-3e4445cd0360bf81533df61e8cec0880a09142f0.zip |
Define the pointer hash struct before the string one, to improve compatibility
with ICC. Patch contributed by Bjørn Wennberg.
llvm-svn: 18663
-rw-r--r-- | llvm/include/llvm/ADT/HashExtras.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/include/llvm/ADT/HashExtras.h b/llvm/include/llvm/ADT/HashExtras.h index f82115a07c5..ab9b302ff1b 100644 --- a/llvm/include/llvm/ADT/HashExtras.h +++ b/llvm/include/llvm/ADT/HashExtras.h @@ -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 <class T> struct hash<T *> { } }; +template <> struct hash<std::string> { + size_t operator()(std::string const &str) const { + return hash<char const *>()(str.c_str()); + } +}; + } // End namespace std #endif |