rsx: simple_array<T> improvements
- Implement move and copy ctors
This commit is contained in:
@@ -716,6 +716,21 @@ namespace rsx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
simple_array(const simple_array<Ty>& other)
|
||||||
|
{
|
||||||
|
_capacity = other._capacity;
|
||||||
|
_size = other._size;
|
||||||
|
|
||||||
|
const auto size_bytes = sizeof(Ty) * _capacity;
|
||||||
|
_data = (Ty*)malloc(size_bytes);
|
||||||
|
std::memcpy(_data, other._data, size_bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
simple_array(simple_array<Ty>&& other) noexcept
|
||||||
|
{
|
||||||
|
swap(other);
|
||||||
|
}
|
||||||
|
|
||||||
~simple_array()
|
~simple_array()
|
||||||
{
|
{
|
||||||
if (_data)
|
if (_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user