mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
now if Derived has the DirectAccess flag, then MatrixBase<Derived>::coeff() const returns a const Scalar& and not a Scalar as before.
useful for people doing direct access. + 1 bugfix thanks to Patrick Mihelich, forgot a & in MapBase::coeff(int).
This commit is contained in:
@@ -96,7 +96,7 @@ template<typename Derived> class MapBase
|
||||
return const_cast<Scalar*>(m_data)[row + col * stride()];
|
||||
}
|
||||
|
||||
inline const Scalar coeff(int index) const
|
||||
inline const Scalar& coeff(int index) const
|
||||
{
|
||||
ei_assert(Derived::IsVectorAtCompileTime || (ei_traits<Derived>::Flags & LinearAccessBit));
|
||||
if ( ((RowsAtCompileTime == 1) == IsRowMajor) )
|
||||
|
||||
Reference in New Issue
Block a user