diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 90c552f13..66e030b1c 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -606,13 +606,13 @@ struct unary_evaluator, IndexBased > protected: // this helper permits to completely eliminate the functor if it is empty - class Data : private UnaryOp + struct Data { - public: EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - Data(const XprType& xpr) : UnaryOp(xpr.functor()), argImpl(xpr.nestedExpression()) {} + Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const UnaryOp& func() const { return static_cast(*this); } + const UnaryOp& func() const { return op; } + UnaryOp op; evaluator argImpl; }; @@ -700,12 +700,13 @@ struct ternary_evaluator, IndexBased protected: // this helper permits to completely eliminate the functor if it is empty - struct Data : private TernaryOp + struct Data { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - Data(const XprType& xpr) : TernaryOp(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {} + Data(const XprType& xpr) : op(xpr.functor()), arg1Impl(xpr.arg1()), arg2Impl(xpr.arg2()), arg3Impl(xpr.arg3()) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const TernaryOp& func() const { return static_cast(*this); } + const TernaryOp& func() const { return op; } + TernaryOp op; evaluator arg1Impl; evaluator arg2Impl; evaluator arg3Impl; @@ -793,12 +794,13 @@ struct binary_evaluator, IndexBased, IndexBase protected: // this helper permits to completely eliminate the functor if it is empty - struct Data : private BinaryOp + struct Data { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - Data(const XprType& xpr) : BinaryOp(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {} + Data(const XprType& xpr) : op(xpr.functor()), lhsImpl(xpr.lhs()), rhsImpl(xpr.rhs()) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const BinaryOp& func() const { return static_cast(*this); } + const BinaryOp& func() const { return op; } + BinaryOp op; evaluator lhsImpl; evaluator rhsImpl; }; @@ -858,12 +860,13 @@ struct unary_evaluator, IndexBased> protected: // this helper permits to completely eliminate the functor if it is empty - struct Data : private UnaryOp + struct Data { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - Data(const XprType& xpr) : UnaryOp(xpr.functor()), argImpl(xpr.nestedExpression()) {} + Data(const XprType& xpr) : op(xpr.functor()), argImpl(xpr.nestedExpression()) {} EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const UnaryOp& func() const { return static_cast(*this); } + const UnaryOp& func() const { return op; } + UnaryOp op; evaluator argImpl; };