diff --git a/src/internal/MatrixOps.h b/src/internal/MatrixOps.h index cad341db8..480b7bef9 100644 --- a/src/internal/MatrixOps.h +++ b/src/internal/MatrixOps.h @@ -48,7 +48,7 @@ template class EiSum EiSum(const EiSum& other) : m_lhs(other.m_lhs), m_rhs(other.m_rhs) {} - + EI_INHERIT_ASSIGNMENT_OPERATORS(EiSum) private: @@ -194,8 +194,7 @@ template Derived & EiObject::operator+=(const EiObject& other) { - *this = *this + other; - return *static_cast(this); + return *this = *this + other; } template @@ -203,8 +202,7 @@ template Derived & EiObject::operator-=(const EiObject &other) { - *this = *this - other; - return *static_cast(this); + return *this = *this - other; } template @@ -212,8 +210,7 @@ template Derived & EiObject::operator*=(const EiObject &other) { - *this = *this * other; - return *static_cast(this); + return *this = *this * other; } #endif // EI_MATRIXOPS_H diff --git a/src/internal/MatrixRef.h b/src/internal/MatrixRef.h index 7f45b36d1..7bf3ebe44 100644 --- a/src/internal/MatrixRef.h +++ b/src/internal/MatrixRef.h @@ -48,7 +48,6 @@ template class EiMatrixConstRef return m_matrix._read(row, col); } - protected: const MatrixType& m_matrix; }; diff --git a/src/internal/MatrixStorage.h b/src/internal/MatrixStorage.h index 8e44ae6de..b3b3f9e06 100644 --- a/src/internal/MatrixStorage.h +++ b/src/internal/MatrixStorage.h @@ -32,7 +32,7 @@ template \ Derived & \ EiObject::operator*=(const OtherScalar &other) \ { \ - *this = *this * other; \ - return *static_cast(this); \ + return *this = *this * other; \ } \ \ template \ Derived & \ EiObject::operator/=(const OtherScalar &other) \ { \ - *this = *this / other; \ - return *static_cast(this); \ + return *this = *this / other; \ } EI_MAKE_SCALAR_OPS(int)