🐎 move overload

This commit is contained in:
EntireTwix 2021-07-02 23:45:50 -07:00
parent 1c5f2e1ae6
commit 72cbbd5494
2 changed files with 6 additions and 1 deletions

View file

@ -5,5 +5,6 @@
struct xxHashStringGen struct xxHashStringGen
{ {
XXH64_hash_t operator()(const std::string &str) const noexcept; XXH64_hash_t operator()(const std::string &str) const noexcept;
XXH64_hash_t operator()(std::string &&str) const noexcept;
XXH64_hash_t operator()(std::string_view str) const noexcept; XXH64_hash_t operator()(std::string_view str) const noexcept;
}; };

View file

@ -4,6 +4,10 @@ XXH64_hash_t xxHashStringGen::operator()(const std::string &str) const noexcept
{ {
return XXH3_64bits(str.data(), str.size()); return XXH3_64bits(str.data(), str.size());
} }
XXH64_hash_t xxHashStringGen::operator()(std::string &&str) const noexcept
{
return XXH3_64bits(str.data(), str.size());
}
XXH64_hash_t xxHashStringGen::operator()(std::string_view str) const noexcept XXH64_hash_t xxHashStringGen::operator()(std::string_view str) const noexcept
{ {
return XXH3_64bits(str.data(), str.size()); return XXH3_64bits(str.data(), str.size());