diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-06-09 17:16:05 +0200 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-06-09 17:16:05 +0200 |
commit | 2b7b549e9e2319f0b33615c675b8453adf693fed (patch) | |
tree | b1ff8024bc1b8fa9c2944f3a6c58d53c3518e5e3 /Eigen/src/Core/CwiseBinaryOp.h | |
parent | e242ac9345e728d8e347bb0d48497891e3891276 (diff) |
Fix #131.
Diffstat (limited to 'Eigen/src/Core/CwiseBinaryOp.h')
-rw-r--r-- | Eigen/src/Core/CwiseBinaryOp.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index 6e158fdf1..3593e07d6 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -45,8 +45,19 @@ * \sa MatrixBase::binaryExpr(const MatrixBase<OtherDerived> &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp */ template<typename BinaryOp, typename Lhs, typename Rhs> -struct ei_traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > : ei_traits<Lhs> +struct ei_traits<CwiseBinaryOp<BinaryOp, Lhs, Rhs> > { + // we must not inherit from ei_traits<Lhs> since it incurrs + // the potential to cause problems with MSVC + typedef typename ei_cleantype<Lhs>::type Ancestor; + typedef typename ei_traits<Ancestor>::XprKind XprKind; + enum { + RowsAtCompileTime = ei_traits<Ancestor>::RowsAtCompileTime, + ColsAtCompileTime = ei_traits<Ancestor>::ColsAtCompileTime, + MaxRowsAtCompileTime = ei_traits<Ancestor>::MaxRowsAtCompileTime, + MaxColsAtCompileTime = ei_traits<Ancestor>::MaxColsAtCompileTime + }; + // even though we require Lhs and Rhs to have the same scalar type (see CwiseBinaryOp constructor), // we still want to handle the case when the result type is different. typedef typename ei_result_of< |