diff --git a/include/bx/inline/hash.inl b/include/bx/inline/hash.inl index 62eb5fc..63d078a 100644 --- a/include/bx/inline/hash.inl +++ b/include/bx/inline/hash.inl @@ -61,6 +61,8 @@ namespace bx template inline void HashCrc32::add(const Ty& _data) { + static_assert(isTriviallyCopyable(), "Ty must be trivially copyable type."); + add(&_data, sizeof(Ty) ); } @@ -91,6 +93,8 @@ namespace bx template inline void HashMurmur2A::add(const Ty& _data) { + static_assert(isTriviallyCopyable(), "Ty must be trivially copyable type."); + add(&_data, sizeof(Ty) ); } @@ -115,6 +119,8 @@ namespace bx template inline void HashMurmur3::add(const Ty& _data) { + static_assert(isTriviallyCopyable(), "Ty must be trivially copyable type."); + add(&_data, sizeof(Ty) ); } @@ -142,7 +148,7 @@ namespace bx template inline uint32_t hash(const Ty& _data) { - static_assert(isTriviallyCopyable() ); + static_assert(isTriviallyCopyable(), "Ty must be trivially copyable type."); return hash(&_data, sizeof(Ty) ); }