diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-01-28 21:43:20 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-01-28 21:43:20 +0100 |
commit | c1d900af61561194ad01b16a89da9f9ce1a09723 (patch) | |
tree | b5e05631504694aa63acbd880d4af478fa12b58c /Eigen/src/Core/Transpose.h | |
parent | 12f8bd12a27a9359e0383aed3f44436c08ea3f92 (diff) |
bug #178: remove additional const on nested expression, and remove several const_cast.
Diffstat (limited to 'Eigen/src/Core/Transpose.h')
-rw-r--r-- | Eigen/src/Core/Transpose.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index f199d1086..bc232526a 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -54,6 +54,8 @@ template<typename MatrixType> class Transpose { public: + typedef typename internal::ref_selector<MatrixType>::non_const_type MatrixTypeNested; + typedef typename TransposeImpl<MatrixType,typename internal::traits<MatrixType>::StorageKind>::Base Base; EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose) typedef typename internal::remove_all<MatrixType>::type NestedExpression; @@ -68,16 +70,16 @@ template<typename MatrixType> class Transpose /** \returns the nested expression */ EIGEN_DEVICE_FUNC - const typename internal::remove_all<typename MatrixType::Nested>::type& + const typename internal::remove_all<MatrixTypeNested>::type& nestedExpression() const { return m_matrix; } /** \returns the nested expression */ EIGEN_DEVICE_FUNC - typename internal::remove_all<typename MatrixType::Nested>::type& - nestedExpression() { return m_matrix.const_cast_derived(); } + typename internal::remove_reference<MatrixTypeNested>::type& + nestedExpression() { return m_matrix; } protected: - typename MatrixType::Nested m_matrix; + typename internal::ref_selector<MatrixType>::non_const_type m_matrix; }; namespace internal { |