From 72cbbd5494ae124855a73b74c5d12e3dba44a6c1 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Fri, 2 Jul 2021 23:45:50 -0700 Subject: [PATCH] :racehorse: move overload --- include/xxhash_str.h | 1 + src/xxhash_str.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 +}