check size before copy
This commit is contained in:
@@ -362,7 +362,7 @@ Col<eT>::operator=(const std::initializer_list<eT>& list)
|
||||
|
||||
(*this).set_size(N,1);
|
||||
|
||||
arrayops::copy( (*this).memptr(), list.begin(), N );
|
||||
if(N > 0) { arrayops::copy( (*this).memptr(), list.begin(), N ); }
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ Row<eT>::operator=(const std::initializer_list<eT>& list)
|
||||
|
||||
(*this).set_size(1, N);
|
||||
|
||||
arrayops::copy( (*this).memptr(), list.begin(), N );
|
||||
if(N > 0) { arrayops::copy( (*this).memptr(), list.begin(), N ); }
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user