Skip to content
Snippets Groups Projects
Commit 386e9647 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed Array's move-assignment operator

parent 7431697c
No related branches found
No related tags found
1 merge request!31Code revision
......@@ -129,7 +129,7 @@ class Array : public Object
*
* @param array is an array to be moved
*/
Array( Array&& array );
Array( Array&& array ) = default;
/**
* \brief Initialize the array from initializer list, i.e. { ... }
......
......@@ -109,23 +109,6 @@ Array( Array< Value, Device, Index >& array,
}
}
template< typename Value,
typename Device,
typename Index >
Array< Value, Device, Index >::
Array( Array< Value, Device, Index >&& array )
{
this->size = array.size;
this->data = array.data;
this->allocationPointer = array.allocationPointer;
this->referenceCounter = array.referenceCounter;
array.size = 0;
array.data = nullptr;
array.allocationPointer = nullptr;
array.referenceCounter = nullptr;
}
template< typename Value,
typename Device,
typename Index >
......@@ -528,6 +511,8 @@ Array< Value, Device, Index >&
Array< Value, Device, Index >::
operator=( Array< Value, Device, Index >&& array )
{
reset();
this->size = array.size;
this->data = array.data;
this->allocationPointer = array.allocationPointer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment