Commit 386e9647 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed Array's move-assignment operator

parent 7431697c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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. { ... }
+2 −17
Original line number Diff line number Diff line
@@ -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;