Evaluators: Remove member variables if known at compile-time.

Also, use composition instead of inheritance in EvalToTemp evaluator.
This commit is contained in:
Jitse Niesen
2012-07-06 14:50:03 +01:00
parent 7bfd8eabff
commit b1b6864c88
2 changed files with 116 additions and 81 deletions

View File

@@ -77,11 +77,12 @@ struct traits<Diagonal<MatrixType,DiagIndex> >
};
}
template<typename MatrixType, int DiagIndex> class Diagonal
: public internal::dense_xpr_base< Diagonal<MatrixType,DiagIndex> >::type
template<typename MatrixType, int _DiagIndex> class Diagonal
: public internal::dense_xpr_base< Diagonal<MatrixType,_DiagIndex> >::type
{
public:
enum { DiagIndex = _DiagIndex };
typedef typename internal::dense_xpr_base<Diagonal>::type Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)