Generalize static assertions on matching sizes to avoid the need for SizeAtCompileTime

This commit is contained in:
Gael Guennebaud
2014-06-25 17:22:12 +02:00
parent 199ac3f2e7
commit 3b19b466a7
2 changed files with 6 additions and 1 deletions

View File

@@ -216,6 +216,11 @@ template<int _Rows, int _Cols> struct size_at_compile_time
enum { ret = (_Rows==Dynamic || _Cols==Dynamic) ? Dynamic : _Rows * _Cols };
};
template<typename XprType> struct size_of_xpr_at_compile_time
{
enum { ret = size_at_compile_time<traits<XprType>::RowsAtCompileTime,traits<XprType>::ColsAtCompileTime>::ret };
};
/* plain_matrix_type : the difference from eval is that plain_matrix_type is always a plain matrix type,
* whereas eval is a const reference in the case of a matrix
*/