diff --git a/include/rexy/hash.hpp b/include/rexy/hash.hpp index 400f960..7507939 100644 --- a/include/rexy/hash.hpp +++ b/include/rexy/hash.hpp @@ -26,7 +26,7 @@ namespace rexy{ template struct hash{ - constexpr size_t operator()(const T& t, size_t salt)const noexcept{ + constexpr size_t operator()(const T& t, size_t salt = 0)const noexcept{ constexpr size_t bytes = sizeof(size_t); size_t val = static_cast(t); size_t hash = 5381 + salt; //magic hash number diff --git a/include/rexy/string_hash.hpp b/include/rexy/string_hash.hpp index b40594e..e22f300 100644 --- a/include/rexy/string_hash.hpp +++ b/include/rexy/string_hash.hpp @@ -27,7 +27,7 @@ namespace rexy{ //jenkns one at a time hash template struct string_hash{ - constexpr size_t operator()(const Str& s, size_t salt)const noexcept{ + constexpr size_t operator()(const Str& s, size_t salt = 0)const noexcept{ size_t hash = salt; for(size_t i = 0;i < s.length();++i){ hash += s[i];