diff --git a/include/bx/hash.h b/include/bx/hash.h index ec0b816..523c73c 100644 --- a/include/bx/hash.h +++ b/include/bx/hash.h @@ -7,6 +7,7 @@ #define BX_HASH_H_HEADER_GUARD #include "allocator.h" // isAligned +#include "string.h" // StringView namespace bx { @@ -55,6 +56,12 @@ namespace bx template uint32_t hashMurmur2A(const Ty& _data); + /// + uint32_t hashMurmur2A(const StringView& _data); + + /// + uint32_t hashMurmur2A(const char* _data); + } // namespace bx #include "hash.inl" diff --git a/include/bx/hash.inl b/include/bx/hash.inl index cfa3eca..50da33f 100644 --- a/include/bx/hash.inl +++ b/include/bx/hash.inl @@ -151,4 +151,14 @@ namespace bx return hashMurmur2A(&_data, sizeof(Ty) ); } + inline uint32_t hashMurmur2A(const StringView& _data) + { + return hashMurmur2A(_data.getPtr(), _data.getLength() ); + } + + inline uint32_t hashMurmur2A(const char* _data) + { + return hashMurmur2A(StringView(_data) ); + } + } // namespace bx diff --git a/include/bx/string.h b/include/bx/string.h index ab1b5d8..ccdebda 100644 --- a/include/bx/string.h +++ b/include/bx/string.h @@ -10,7 +10,6 @@ #include // wchar_t #include "allocator.h" -#include "hash.h" namespace bx { @@ -244,12 +243,6 @@ namespace bx /// int32_t toString(char* _out, size_t _max, uint64_t _value, uint32_t _base = 10); - /// - uint32_t hashMurmur2A(const StringView& _data); - - /// - uint32_t hashMurmur2A(const char* _data); - } // namespace bx #include "string.inl" diff --git a/include/bx/string.inl b/include/bx/string.inl index ed60b5c..d9569f3 100644 --- a/include/bx/string.inl +++ b/include/bx/string.inl @@ -116,16 +116,6 @@ namespace bx return m_len; } - inline uint32_t hashMurmur2A(const StringView& _data) - { - return hashMurmur2A(_data.getPtr(), _data.getLength() ); - } - - inline uint32_t hashMurmur2A(const char* _data) - { - return hashMurmur2A(StringView(_data) ); - } - template inline StringT::StringT() : StringView() diff --git a/tests/handle_test.cpp b/tests/handle_test.cpp index 5bcd6f8..b82e1da 100644 --- a/tests/handle_test.cpp +++ b/tests/handle_test.cpp @@ -5,7 +5,7 @@ #include "test.h" #include -#include +#include TEST_CASE("HandleListT", "") {