From: Chris Lattner Date: Wed, 8 Dec 2004 20:59:18 +0000 (+0000) Subject: Define the pointer hash struct before the string one, to improve compatibility X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d828e340a80f268a6e51d451a75fb6c2282e17b1;p=oota-llvm.git Define the pointer hash struct before the string one, to improve compatibility with ICC. Patch contributed by Bjørn Wennberg. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18663 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/HashExtras.h b/include/llvm/ADT/HashExtras.h index f82115a07c5..ab9b302ff1b 100644 --- a/include/llvm/ADT/HashExtras.h +++ b/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 { - size_t operator()(std::string const &str) const { - return hash()(str.c_str()); - } -}; - // Provide a hash function for arbitrary pointers... template struct hash { inline size_t operator()(const T *Val) const { @@ -36,6 +30,12 @@ template struct hash { } }; +template <> struct hash { + size_t operator()(std::string const &str) const { + return hash()(str.c_str()); + } +}; + } // End namespace std #endif