Commit 569ccc9a authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed move-constructor in Array

parent 3e785f01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ class Array
       *
       * \param array The array to be moved.
       */
      Array( Array&& array ) = default;
      Array( Array&& array );

      /**
       * \brief Constructor which initializes the array by copying elements from
+17 −0
Original line number Diff line number Diff line
@@ -25,6 +25,23 @@
namespace TNL {
namespace Containers {

template< typename Value,
          typename Device,
          typename Index,
          typename Allocator >
Array< Value, Device, Index, Allocator >::
Array( Array&& array )
: size( std::move(array.size) ),
  data( std::move(array.data) ),
  allocationPointer( std::move(array.allocationPointer) ),
  referenceCounter( std::move(array.referenceCounter) ),
  allocator( std::move(array.allocator) )
{
   array.data = nullptr;
   array.allocationPointer = nullptr;
   array.referenceCounter = nullptr;
}

template< typename Value,
          typename Device,
          typename Index,