diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 1c2521031..568493cba 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -126,7 +126,11 @@ template class DenseSt DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(internal::constructor_without_unaligned_array_assert()) {} DenseStorage(const DenseStorage& other) : m_data(other.m_data) {} - DenseStorage& operator=(DenseStorage other) { other.swap(*this); return *this; } + DenseStorage& operator=(const DenseStorage& other) + { + if (this != &other) m_data = other.m_data; + return *this; + } DenseStorage(DenseIndex,DenseIndex,DenseIndex) {} void swap(DenseStorage& other) { std::swap(m_data,other.m_data); } static DenseIndex rows(void) {return _Rows;} @@ -176,7 +180,16 @@ template class DenseStorage class DenseStorage class DenseStorage