1227825Stheraven// -*- C++ -*- 2227825Stheraven//===------------------------- hash_set ------------------------------------===// 3227825Stheraven// 4227825Stheraven// The LLVM Compiler Infrastructure 5227825Stheraven// 6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open 7227825Stheraven// Source Licenses. See LICENSE.TXT for details. 8227825Stheraven// 9227825Stheraven//===----------------------------------------------------------------------===// 10227825Stheraven 11227825Stheraven#ifndef _LIBCPP_EXT_HASH 12227825Stheraven#define _LIBCPP_EXT_HASH 13227825Stheraven 14227825Stheraven#pragma GCC system_header 15227825Stheraven 16227825Stheraven#include <string> 17227825Stheraven#include <cstring> 18227825Stheraven 19227825Stheravennamespace __gnu_cxx { 20227825Stheravenusing namespace std; 21227825Stheraven 22249998Sdimtemplate <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T> 23227825Stheraven { }; 24227825Stheraven 25249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS hash<const char*> 26227825Stheraven : public unary_function<const char*, size_t> 27227825Stheraven{ 28227825Stheraven _LIBCPP_INLINE_VISIBILITY 29227825Stheraven size_t operator()(const char *__c) const _NOEXCEPT 30227825Stheraven { 31227825Stheraven return __do_string_hash(__c, __c + strlen(__c)); 32227825Stheraven } 33227825Stheraven}; 34227825Stheraven 35249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS hash<char *> 36227825Stheraven : public unary_function<char*, size_t> 37227825Stheraven{ 38227825Stheraven _LIBCPP_INLINE_VISIBILITY 39227825Stheraven size_t operator()(char *__c) const _NOEXCEPT 40227825Stheraven { 41227825Stheraven return __do_string_hash<const char *>(__c, __c + strlen(__c)); 42227825Stheraven } 43227825Stheraven}; 44227825Stheraven} 45227825Stheraven 46242945Stheraven#endif // _LIBCPP_EXT_HASH 47