From 175976e796c5a58c538ee2a34a4b83946ddc71a8 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Thu, 8 Jul 2021 14:58:30 -0700 Subject: [PATCH] :zap: string move overload --- include/xxhash_str.h | 1 + src/xxhash_str.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/xxhash_str.h b/include/xxhash_str.h index 0f93cb0..a83321a 100644 --- a/include/xxhash_str.h +++ b/include/xxhash_str.h @@ -6,4 +6,5 @@ struct xxHashStringGen { 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 &&str) const noexcept; }; diff --git a/src/xxhash_str.cpp b/src/xxhash_str.cpp index 3a984aa..0917e48 100644 --- a/src/xxhash_str.cpp +++ b/src/xxhash_str.cpp @@ -5,6 +5,10 @@ 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_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()); } \ No newline at end of file