mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-03 01:04:23 +08:00
Generalize static assertions on matching sizes to avoid the need for SizeAtCompileTime
This commit is contained in:
parent
199ac3f2e7
commit
3b19b466a7
@ -159,7 +159,7 @@
|
||||
|
||||
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0,TYPE1) \
|
||||
( \
|
||||
(int(TYPE0::SizeAtCompileTime)==0 && int(TYPE1::SizeAtCompileTime)==0) \
|
||||
(int(internal::size_of_xpr_at_compile_time<TYPE0>::ret)==0 && int(internal::size_of_xpr_at_compile_time<TYPE1>::ret)==0) \
|
||||
|| (\
|
||||
(int(TYPE0::RowsAtCompileTime)==Eigen::Dynamic \
|
||||
|| int(TYPE1::RowsAtCompileTime)==Eigen::Dynamic \
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user