CommaInitializer wrongfully asserted for 0-sized blocks

commainitialier unit-test never actually called `test_block_recursion`, which also was not correctly implemented and would have caused too deep template recursion.
This commit is contained in:
Christoph Hertzberg
2020-04-13 16:41:20 +02:00
parent c854e189e6
commit d46d726e9d
2 changed files with 18 additions and 10 deletions

View File

@@ -43,7 +43,7 @@ struct CommaInitializer
inline CommaInitializer(XprType& xpr, const DenseBase<OtherDerived>& other)
: m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows())
{
eigen_assert(m_xpr.rows() > 0 && m_xpr.cols() > 0
eigen_assert(m_xpr.rows() >= other.rows() && m_xpr.cols() >= other.cols()
&& "Cannot comma-initialize a 0x0 matrix (operator<<)");
m_xpr.block(0, 0, other.rows(), other.cols()) = other;
}