diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h index dc17284e2..87d1d4145 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h @@ -245,10 +245,10 @@ operator-(const Scalar& scalar) const return *this + (-scalar); } -friend inline const CwiseUnaryOp, Derived> +friend inline const CwiseUnaryOp, CwiseUnaryOp,Derived> > operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& other) { - return other + (-scalar); + return (-other) + scalar; } /** Substracts the given \a scalar from each coeff of this expression.