diff --git a/Eigen/src/Core/GlobalFunctions.h b/Eigen/src/Core/GlobalFunctions.h index 44d610f25..c94b578dd 100644 --- a/Eigen/src/Core/GlobalFunctions.h +++ b/Eigen/src/Core/GlobalFunctions.h @@ -28,7 +28,7 @@ #define EIGEN_ARRAY_DECLARE_GLOBAL_STD_UNARY(NAME,FUNCTOR) \ template \ - inline const Eigen::CwiseUnaryOp, Derived> \ + inline const Eigen::CwiseUnaryOp, const Derived> \ NAME(const Eigen::ArrayBase& x) { \ return x.derived(); \ } @@ -38,7 +38,7 @@ template \ struct NAME##_retval > \ { \ - typedef const Eigen::CwiseUnaryOp, Derived> type; \ + typedef const Eigen::CwiseUnaryOp, const Derived> type; \ }; \ template \ struct NAME##_impl > \ @@ -62,7 +62,7 @@ namespace std EIGEN_ARRAY_DECLARE_GLOBAL_STD_UNARY(sqrt,scalar_sqrt_op) template - inline const Eigen::CwiseUnaryOp, Derived> + inline const Eigen::CwiseUnaryOp, const Derived> pow(const Eigen::ArrayBase& x, const typename Derived::Scalar& exponent) { \ return x.derived().pow(exponent); \ } diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h index 3928b6bc9..7d509e78f 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h @@ -136,7 +136,7 @@ operator-(const Scalar& scalar) const return *this + (-scalar); } -friend inline const CwiseUnaryOp, CwiseUnaryOp, const Derived> > +friend inline const CwiseUnaryOp, const CwiseUnaryOp, const Derived> > operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& other) { return (-other) + scalar;