aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreivanov89 <eivanov89@yandex-team.com>2025-04-22 20:43:32 +0300
committereivanov89 <eivanov89@yandex-team.com>2025-04-22 21:16:35 +0300
commit435e62e7e0da35210e46b107d6461d288beba82a (patch)
treee0be7dbd57e8dfbeecebfa6b74ddb5bce9d19165
parent214eeca8ec63cab6bf57e6c91bf0d1f88910ba71 (diff)
downloadydb-435e62e7e0da35210e46b107d6461d288beba82a.tar.gz
Add missing move constructor and move assignment
commit_hash:ca0a881f294c00b673673335c9366699c4be7c86
-rw-r--r--library/cpp/histogram/hdr/histogram.cpp12
-rw-r--r--library/cpp/histogram/hdr/histogram.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/library/cpp/histogram/hdr/histogram.cpp b/library/cpp/histogram/hdr/histogram.cpp
index a213d5d8fd3..175179f38ae 100644
--- a/library/cpp/histogram/hdr/histogram.cpp
+++ b/library/cpp/histogram/hdr/histogram.cpp
@@ -44,6 +44,18 @@ namespace NHdr {
{
}
+ THistogram::THistogram(THistogram&& other) noexcept
+ : Data_(std::move(other.Data_))
+ , Allocator_(other.Allocator_)
+ {
+ }
+
+ THistogram& THistogram::operator=(THistogram&& rhs) noexcept {
+ Data_ = std::move(rhs.Data_);
+ Allocator_ = rhs.Allocator_;
+ return *this;
+ }
+
THistogram::~THistogram() {
if (Data_) {
size_t size = GetMemorySize();
diff --git a/library/cpp/histogram/hdr/histogram.h b/library/cpp/histogram/hdr/histogram.h
index 5f1cebbd9f3..d6f23baa0cc 100644
--- a/library/cpp/histogram/hdr/histogram.h
+++ b/library/cpp/histogram/hdr/histogram.h
@@ -68,6 +68,9 @@ namespace NHdr {
i32 numberOfSignificantValueDigits,
IAllocator* allocator = TDefaultAllocator::Instance());
+ THistogram(THistogram&& other) noexcept;
+ THistogram& operator=(THistogram&& rhs) noexcept;
+
~THistogram();
// Histogram structure querying support -----------------------------------