Add static assertion for fixed sizes Ref<>

(grafted from f7d17689a5
)
This commit is contained in:
Gael Guennebaud
2018-03-09 10:11:13 +01:00
parent 190b46dd1f
commit 1724dae8b8
2 changed files with 15 additions and 1 deletions

View File

@@ -95,6 +95,8 @@ protected:
template<typename Expression>
EIGEN_DEVICE_FUNC void construct(Expression& expr)
{
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(PlainObjectType,Expression);
if(PlainObjectType::RowsAtCompileTime==1)
{
eigen_assert(expr.rows()==1 || expr.cols()==1);