Hi,
you must pass a const reference object as argument, always. Replace the argument by `const Eigen::DenseCoeffsBase<...>&`. See https://eigen.tuxfamily.org/dox/TopicFunctionTakingEigenTypes.html for details. Joseph On 28/07/2020 12:00, Janos Meny wrote: > Hey Eigen community, > I was trying to write a function taking in any eigen expression which > has direct memory access. That is I am looking for the expression type > which has access to a memory location and associated size and stride > information. I think the correct type for this should be > Eigen::DenseCoeffsBase<Derived, Eigen::DirectWriteAccess>. Am I right > in assuming so? Unfortunately casting an derived type into this > expression is resulting dangling references, see e.g > https://godbolt.org/z/KPdcoG. Can someone point me out what I am doing > wrong? > cheers > Janos Meny
