From a91de27e983d9f752eb9745be0a53f145eb23d5b Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 23 Nov 2016 12:24:48 +0100 Subject: [PATCH] Fix compilation issue with MSVC: MSVC always messes up with shadowed template arguments, for instance in: struct B { typedef float T; } template struct A : B { T g; }; The type of A::g will be float and not double. --- Eigen/src/SparseCore/SparseCwiseBinaryOp.h | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h index 04cef66fc..4ba4d631d 100644 --- a/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +++ b/Eigen/src/SparseCore/SparseCwiseBinaryOp.h @@ -394,10 +394,10 @@ struct sparse_conjunction_evaluator { protected: typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs Lhs; - typedef typename XprType::Rhs Rhs; - typedef typename evaluator::InnerIterator LhsIterator; - typedef typename evaluator::InnerIterator RhsIterator; + typedef typename XprType::Lhs LhsArg; + typedef typename XprType::Rhs RhsArg; + typedef typename evaluator::InnerIterator LhsIterator; + typedef typename evaluator::InnerIterator RhsIterator; typedef typename XprType::StorageIndex StorageIndex; typedef typename traits::Scalar Scalar; public: @@ -449,7 +449,7 @@ public: enum { - CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, + CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, Flags = XprType::Flags }; @@ -468,8 +468,8 @@ public: protected: const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; + evaluator m_lhsImpl; + evaluator m_rhsImpl; }; // "dense ^ sparse" @@ -479,10 +479,10 @@ struct sparse_conjunction_evaluator { protected: typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs Lhs; - typedef typename XprType::Rhs Rhs; - typedef evaluator LhsEvaluator; - typedef typename evaluator::InnerIterator RhsIterator; + typedef typename XprType::Lhs LhsArg; + typedef typename XprType::Rhs RhsArg; + typedef evaluator LhsEvaluator; + typedef typename evaluator::InnerIterator RhsIterator; typedef typename XprType::StorageIndex StorageIndex; typedef typename traits::Scalar Scalar; public: @@ -490,7 +490,7 @@ public: class ReverseInnerIterator; class InnerIterator { - enum { IsRowMajor = (int(Rhs::Flags)&RowMajorBit)==RowMajorBit }; + enum { IsRowMajor = (int(RhsArg::Flags)&RowMajorBit)==RowMajorBit }; public: @@ -522,9 +522,9 @@ public: enum { - CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, + CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, // Expose storage order of the sparse expression - Flags = (XprType::Flags & ~RowMajorBit) | (int(Rhs::Flags)&RowMajorBit) + Flags = (XprType::Flags & ~RowMajorBit) | (int(RhsArg::Flags)&RowMajorBit) }; explicit sparse_conjunction_evaluator(const XprType& xpr) @@ -542,8 +542,8 @@ public: protected: const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; + evaluator m_lhsImpl; + evaluator m_rhsImpl; }; // "sparse ^ dense" @@ -553,10 +553,10 @@ struct sparse_conjunction_evaluator { protected: typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs Lhs; - typedef typename XprType::Rhs Rhs; - typedef typename evaluator::InnerIterator LhsIterator; - typedef evaluator RhsEvaluator; + typedef typename XprType::Lhs LhsArg; + typedef typename XprType::Rhs RhsArg; + typedef typename evaluator::InnerIterator LhsIterator; + typedef evaluator RhsEvaluator; typedef typename XprType::StorageIndex StorageIndex; typedef typename traits::Scalar Scalar; public: @@ -564,7 +564,7 @@ public: class ReverseInnerIterator; class InnerIterator { - enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit }; + enum { IsRowMajor = (int(LhsArg::Flags)&RowMajorBit)==RowMajorBit }; public: @@ -590,16 +590,16 @@ public: protected: LhsIterator m_lhsIter; - const evaluator &m_rhsEval; + const evaluator &m_rhsEval; const BinaryOp& m_functor; const Index m_outer; }; enum { - CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, + CoeffReadCost = evaluator::CoeffReadCost + evaluator::CoeffReadCost + functor_traits::Cost, // Expose storage order of the sparse expression - Flags = (XprType::Flags & ~RowMajorBit) | (int(Lhs::Flags)&RowMajorBit) + Flags = (XprType::Flags & ~RowMajorBit) | (int(LhsArg::Flags)&RowMajorBit) }; explicit sparse_conjunction_evaluator(const XprType& xpr) @@ -617,8 +617,8 @@ public: protected: const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; + evaluator m_lhsImpl; + evaluator m_rhsImpl; }; }