diff --git a/include/xxhash_str.h b/include/xxhash_str.h index aab219a..5e7cd31 100644 --- a/include/xxhash_str.h +++ b/include/xxhash_str.h @@ -5,5 +5,6 @@ struct xxHashStringGen { 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; }; diff --git a/src/xxhash_str.cpp b/src/xxhash_str.cpp index 7816fb6..abfb2cb 100644 --- a/src/xxhash_str.cpp +++ b/src/xxhash_str.cpp @@ -4,7 +4,11 @@ XXH64_hash_t xxHashStringGen::operator()(const std::string &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()); +} XXH64_hash_t xxHashStringGen::operator()(std::string_view str) const noexcept { return XXH3_64bits(str.data(), str.size()); -} \ No newline at end of file +}