add util::Buffer copy constructor

This commit is contained in:
MihailRis 2024-09-16 21:31:37 +03:00
parent 9badc0a022
commit f05ed4942d

View File

@ -12,6 +12,7 @@ namespace util {
Buffer(size_t length)
: ptr(std::make_unique<T[]>(length)), length(length) {
}
Buffer(const Buffer<T>& o) : Buffer(o.data(), o.size()) {}
Buffer(std::unique_ptr<T[]> ptr, size_t length)
: ptr(std::move(ptr)), length(length) {}