diff options
Diffstat (limited to 'cpputil')
-rw-r--r-- | cpputil/databuffer.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cpputil/databuffer.h b/cpputil/databuffer.h index d46944d4b..8d34e1a7d 100644 --- a/cpputil/databuffer.h +++ b/cpputil/databuffer.h @@ -32,7 +32,15 @@ class DataBuffer { } return *this; } - DataBuffer& operator=(DataBuffer&&) = default; + DataBuffer& operator=(DataBuffer&& other) { + if (this == &other) { + data_ = other.data_; + len_ = other.len_; + other.data_ = nullptr; + other.len_ = 0; + } + return *this; + } void Allocate(size_t l) { delete[] data_; |