string move overload

This commit is contained in:
EntireTwix 2021-07-08 14:58:30 -07:00
parent da89d390ea
commit 175976e796
2 changed files with 5 additions and 0 deletions

View file

@ -6,4 +6,5 @@ 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_view &&str) const noexcept; XXH64_hash_t operator()(std::string_view &&str) const noexcept;
XXH64_hash_t operator()(std::string &&str) const noexcept;
}; };

View file

@ -5,6 +5,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_view &&str) const noexcept XXH64_hash_t xxHashStringGen::operator()(std::string_view &&str) const noexcept
{
return XXH3_64bits(str.data(), str.size());
}
XXH64_hash_t xxHashStringGen::operator()(std::string &&str) const noexcept
{ {
return XXH3_64bits(str.data(), str.size()); return XXH3_64bits(str.data(), str.size());
} }