Changeset 2107
- Timestamp:
- Nov 22, 2012, 9:31:18 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/hash.cpp
r2105 r2107 88 88 */ 89 89 90 uint32_t Hash<int8_t>::operator ()(int8_t x) 90 uint32_t Hash<int8_t>::operator ()(int8_t x) const 91 91 { 92 92 return Hash8((uint8_t)x); 93 93 } 94 94 95 uint32_t Hash<uint8_t>::operator ()(uint8_t x) 95 uint32_t Hash<uint8_t>::operator ()(uint8_t x) const 96 96 { 97 97 return Hash8(x); 98 98 } 99 99 100 uint32_t Hash<int16_t>::operator ()(int16_t x) 100 uint32_t Hash<int16_t>::operator ()(int16_t x) const 101 101 { 102 102 return Hash16((uint16_t)x); 103 103 } 104 104 105 uint32_t Hash<uint16_t>::operator ()(uint16_t x) 105 uint32_t Hash<uint16_t>::operator ()(uint16_t x) const 106 106 { 107 107 return Hash16(x); 108 108 } 109 109 110 uint32_t Hash<int32_t>::operator ()(int32_t x) 110 uint32_t Hash<int32_t>::operator ()(int32_t x) const 111 111 { 112 112 return Hash32((uint32_t)x); 113 113 } 114 114 115 uint32_t Hash<uint32_t>::operator ()(uint32_t x) 115 uint32_t Hash<uint32_t>::operator ()(uint32_t x) const 116 116 { 117 117 return Hash32(x); 118 118 } 119 119 120 uint32_t Hash<int64_t>::operator ()(int64_t x) 120 uint32_t Hash<int64_t>::operator ()(int64_t x) const 121 121 { 122 122 return Hash64((uint64_t)x); 123 123 } 124 124 125 uint32_t Hash<uint64_t>::operator ()(uint64_t x) 125 uint32_t Hash<uint64_t>::operator ()(uint64_t x) const 126 126 { 127 127 return Hash64(x); … … 132 132 */ 133 133 134 uint32_t Hash<half>::operator ()(half f) 134 uint32_t Hash<half>::operator ()(half f) const 135 135 { 136 136 return Hash16(f.bits); 137 137 } 138 138 139 uint32_t Hash<float>::operator ()(float f) 139 uint32_t Hash<float>::operator ()(float f) const 140 140 { 141 141 union { float tmp; uint32_t x; } u = { f }; … … 143 143 } 144 144 145 uint32_t Hash<double>::operator ()(double f) 145 uint32_t Hash<double>::operator ()(double f) const 146 146 { 147 147 union { double tmp; uint64_t x; } u = { f }; … … 163 163 } 164 164 165 uint32_t Hash<char const *>::operator ()(char const *s) 165 uint32_t Hash<char const *>::operator ()(char const *s) const 166 166 { 167 167 return HashCharString(s); 168 168 } 169 169 170 uint32_t Hash<String>::operator ()(String const &s) 170 uint32_t Hash<String>::operator ()(String const &s) const 171 171 { 172 172 return HashCharString(&s[0]); -
trunk/src/lol/core/hash.h
r2105 r2107 23 23 template<typename T> class Hash; 24 24 25 template<> class Hash<int8_t> { public: uint32_t operator()(int8_t) ; };26 template<> class Hash<uint8_t> { public: uint32_t operator()(uint8_t) ; };27 template<> class Hash<int16_t> { public: uint32_t operator()(int16_t) ; };28 template<> class Hash<uint16_t> { public: uint32_t operator()(uint16_t) ; };29 template<> class Hash<int32_t> { public: uint32_t operator()(int32_t) ; };30 template<> class Hash<uint32_t> { public: uint32_t operator()(uint32_t) ; };31 template<> class Hash<int64_t> { public: uint32_t operator()(int64_t) ; };32 template<> class Hash<uint64_t> { public: uint32_t operator()(uint64_t) ; };25 template<> class Hash<int8_t> { public: uint32_t operator()(int8_t) const; }; 26 template<> class Hash<uint8_t> { public: uint32_t operator()(uint8_t) const; }; 27 template<> class Hash<int16_t> { public: uint32_t operator()(int16_t) const; }; 28 template<> class Hash<uint16_t> { public: uint32_t operator()(uint16_t) const; }; 29 template<> class Hash<int32_t> { public: uint32_t operator()(int32_t) const; }; 30 template<> class Hash<uint32_t> { public: uint32_t operator()(uint32_t) const; }; 31 template<> class Hash<int64_t> { public: uint32_t operator()(int64_t) const; }; 32 template<> class Hash<uint64_t> { public: uint32_t operator()(uint64_t) const; }; 33 33 34 template<> class Hash<half> { public: uint32_t operator()(half) ; };35 template<> class Hash<float> { public: uint32_t operator()(float) ; };36 template<> class Hash<double> { public: uint32_t operator()(double) ; };37 template<> class Hash<ldouble> { public: uint32_t operator()(ldouble) ; };34 template<> class Hash<half> { public: uint32_t operator()(half) const; }; 35 template<> class Hash<float> { public: uint32_t operator()(float) const; }; 36 template<> class Hash<double> { public: uint32_t operator()(double) const; }; 37 template<> class Hash<ldouble> { public: uint32_t operator()(ldouble) const; }; 38 38 39 39 template<> class Hash<char const *> 40 40 { 41 41 public: 42 uint32_t operator()(char const *x) ;42 uint32_t operator()(char const *x) const; 43 43 }; 44 44 … … 46 46 { 47 47 public: 48 uint32_t operator()(String const &s) ;48 uint32_t operator()(String const &s) const; 49 49 }; 50 50
Note: See TracChangeset
for help on using the changeset viewer.