2 //===------------------------- hash_set ------------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_EXT_HASH
12 #define _LIBCPP_EXT_HASH
14 #pragma GCC system_header
22 template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>
25 template <> struct _LIBCPP_TYPE_VIS hash<const char*>
26 : public unary_function<const char*, size_t>
28 _LIBCPP_INLINE_VISIBILITY
29 size_t operator()(const char *__c) const _NOEXCEPT
31 return __do_string_hash(__c, __c + strlen(__c));
35 template <> struct _LIBCPP_TYPE_VIS hash<char *>
36 : public unary_function<char*, size_t>
38 _LIBCPP_INLINE_VISIBILITY
39 size_t operator()(char *__c) const _NOEXCEPT
41 return __do_string_hash<const char *>(__c, __c + strlen(__c));
46 #endif // _LIBCPP_EXT_HASH