Commit 4403b2dc authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed data corruption error in the Array move-constructor

parent 2c51cea2
......@@ -24,6 +24,7 @@ template< typename Value, typename Device, typename Index, typename Allocator >
Array< Value, Device, Index, Allocator >::Array( Array&& array ) noexcept
: data( std::move( array.data ) ), size( std::move( array.size ) ), allocator( std::move( array.allocator ) )
{
array.size = 0;
array.data = nullptr;
}
......@@ -411,7 +412,6 @@ template< typename Value, typename Device, typename Index, typename Allocator >
Array< Value, Device, Index, Allocator >&
Array< Value, Device, Index, Allocator >::operator=( const Array< Value, Device, Index, Allocator >& array )
{
// TNL_ASSERT_EQ( array.getSize(), this->getSize(), "Array sizes must be the same." );
if( this->getSize() != array.getSize() )
this->setLike( array );
if( this->getSize() > 0 )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment