Skip to content

Commit e788628

Browse files
authored
Update Hash.h
1 parent 63857df commit e788628

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/cppcore/Common/Hash.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ inline THash<T>::THash(T value, T base) :
101101

102102
template <class T>
103103
inline T THash<T>::toHash(const char *buffer, T base) {
104+
static_assert(std::is_integral<T>::value, "THash requires T to be an integral type.");
104105
T hash = 0;
105106
if (nullptr == buffer) {
106107
return hash;
@@ -114,7 +115,7 @@ inline T THash<T>::toHash(const char *buffer, T base) {
114115

115116
return hash;
116117
}
117-
118+
0
118119
template <class T>
119120
inline T THash<T>::toHash(T value, T base) {
120121
const T hash = value % base;

0 commit comments

Comments
 (0)