Skip to content

Commit 435e62e

Browse files
author
eivanov89
committed
Add missing move constructor and move assignment
commit_hash:ca0a881f294c00b673673335c9366699c4be7c86
1 parent 214eeca commit 435e62e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

library/cpp/histogram/hdr/histogram.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ namespace NHdr {
4444
{
4545
}
4646

47+
THistogram::THistogram(THistogram&& other) noexcept
48+
: Data_(std::move(other.Data_))
49+
, Allocator_(other.Allocator_)
50+
{
51+
}
52+
53+
THistogram& THistogram::operator=(THistogram&& rhs) noexcept {
54+
Data_ = std::move(rhs.Data_);
55+
Allocator_ = rhs.Allocator_;
56+
return *this;
57+
}
58+
4759
THistogram::~THistogram() {
4860
if (Data_) {
4961
size_t size = GetMemorySize();

library/cpp/histogram/hdr/histogram.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ namespace NHdr {
6868
i32 numberOfSignificantValueDigits,
6969
IAllocator* allocator = TDefaultAllocator::Instance());
7070

71+
THistogram(THistogram&& other) noexcept;
72+
THistogram& operator=(THistogram&& rhs) noexcept;
73+
7174
~THistogram();
7275

7376
// Histogram structure querying support -----------------------------------

0 commit comments

Comments
 (0)