00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 
00050 #ifndef _cvc3__hash__hash_fun_h_
00051 #define _cvc3__hash__hash_fun_h_
00052 
00053 
00054 #include <cstddef>
00055 
00056 
00057 namespace Hash {
00058   using std::size_t;
00059 
00060   template <class _Key> struct hash { };
00061   
00062   inline size_t __stl_hash_string(const char* __s)
00063   {
00064     unsigned long __h = 0; 
00065     for ( ; *__s; ++__s)
00066       __h = 5*__h + *__s;
00067     
00068     return size_t(__h);
00069   }
00070   
00071   template<> struct hash<char*> {
00072     size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
00073   };
00074 
00075   template<> struct hash<const char*>
00076   {
00077     size_t operator()(const char* __s) const { return __stl_hash_string(__s); }
00078   };
00079   
00080   template<> struct hash<char> {
00081     size_t operator()(char __x) const { return __x; }
00082   };
00083 
00084   template<> struct hash<unsigned char> {
00085     size_t operator()(unsigned char __x) const { return __x; }
00086   };
00087   
00088   template<> struct hash<signed char> {
00089     size_t operator()(unsigned char __x) const { return __x; }
00090   };
00091   
00092   template<> struct hash<short> {
00093     size_t operator()(short __x) const { return __x; }
00094   };
00095 
00096   template<> struct hash<unsigned short> {
00097     size_t operator()(unsigned short __x) const { return __x; }
00098   };
00099 
00100   template<> struct hash<int> {
00101     size_t operator()(int __x) const { return __x; }
00102   };
00103 
00104   template<> struct hash<unsigned int> {
00105     size_t operator()(unsigned int __x) const { return __x; }
00106   };
00107 
00108   template<> struct hash<long> {
00109     size_t operator()(long __x) const { return __x; }
00110   };
00111 
00112   template<> struct hash<unsigned long> {
00113     size_t operator()(unsigned long __x) const { return __x; }
00114   };
00115 
00116 }
00117 
00118 #endif