allow buffer copy.

This commit is contained in:
hecomi
2017-01-06 18:44:43 +09:00
parent b8ae1d6c4a
commit 68d9e30816
3 changed files with 8 additions and 0 deletions
@@ -75,6 +75,14 @@ public:
{
}
Buffer(const Buffer& other)
{
value_.reset();
size_ = 0;
ExpandIfNeeded(other.size_);
memcpy_s(value_.get(), size_, other.value_.get(), other.size_);
}
Buffer<T>& operator=(const Buffer& other)
{
if (&other == this) return *this;