Add cast to aliasing check.

Otherwise, one of the geo tests fails to compile. Now there are some compiler
warnings about aliasing and type-punned pointers that I don't understand.
This commit is contained in:
Jitse Niesen 2010-06-01 17:45:58 +01:00
parent e3e2380548
commit ab2b33e802

View File

@ -296,7 +296,7 @@ struct ei_inverse_impl : public ReturnByValue<ei_inverse_impl<MatrixType> >
template<typename Dest> inline void evalTo(Dest& dst) const
{
// FIXME this is a naive aliasing check that could be improved. It only catches x = x.inverse();
ei_assert(&dst != &m_matrix && "Aliasing problem detected in inverse(), you need to do inverse().eval() here.");
ei_assert(&dst != (Dest*)(&m_matrix) && "Aliasing problem detected in inverse(), you need to do inverse().eval() here.");
ei_compute_inverse<MatrixTypeNestedCleaned, Dest>::run(m_matrix, dst);
}
};