aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins
diff options
context:
space:
mode:
authorGravatar daravi <daravi@alumni.ubc.ca>2020-09-16 02:06:53 +0000
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2020-09-16 02:06:53 +0000
commit6f0f6f792e441c32727ed945686fefe02e6bdbc6 (patch)
treef4c4d5c98546b774d7cb47a95ae0b61337a86c01 /Eigen/src/plugins
parentcc0c38ace87f9b77a21b2ad1b20b0c4f97b24719 (diff)
Fix compiler error due to c++20 operator== generation rules
Diffstat (limited to 'Eigen/src/plugins')
-rw-r--r--Eigen/src/plugins/ArrayCwiseBinaryOps.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h
index 0e5d5445b..1d703b6da 100644
--- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h
+++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h
@@ -131,39 +131,39 @@ const CwiseBinaryOp<internal::scalar_pow_op<Scalar,T>,Derived,Constant<T> > pow(
// TODO code generating macros could be moved to Macros.h and could include generation of documentation
-#define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \
+#define EIGEN_MAKE_CWISE_COMP_OP(OP_NAME, OP, COMPARATOR) \
template<typename OtherDerived> \
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived> \
-OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
+EIGEN_DEVICE_FUNC friend EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived> \
+OP_NAME(const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& lhs, const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived>& rhs) \
{ \
- return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived>(derived(), other.derived()); \
+ return CwiseBinaryOp<internal::scalar_cmp_op<Scalar, typename OtherDerived::Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const OtherDerived>(lhs.derived(), rhs.derived()); \
}\
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar, internal::cmp_ ## COMPARATOR>, const Derived, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> > Cmp ## COMPARATOR ## ReturnType; \
typedef CwiseBinaryOp<internal::scalar_cmp_op<Scalar,Scalar, internal::cmp_ ## COMPARATOR>, const CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject>, const Derived > RCmp ## COMPARATOR ## ReturnType; \
-EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Cmp ## COMPARATOR ## ReturnType \
-OP(const Scalar& s) const { \
- return this->OP(Derived::PlainObject::Constant(rows(), cols(), s)); \
+EIGEN_DEVICE_FUNC friend EIGEN_STRONG_INLINE const Cmp ## COMPARATOR ## ReturnType \
+OP_NAME(const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& lhs, const Scalar& rhs) { \
+ return lhs OP Derived::PlainObject::Constant(lhs.rows(), lhs.cols(), rhs); \
} \
EIGEN_DEVICE_FUNC friend EIGEN_STRONG_INLINE const RCmp ## COMPARATOR ## ReturnType \
-OP(const Scalar& s, const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& d) { \
- return Derived::PlainObject::Constant(d.rows(), d.cols(), s).OP(d); \
+OP_NAME(const Scalar& lhs, const EIGEN_CURRENT_STORAGE_BASE_CLASS<Derived>& rhs) { \
+ return Derived::PlainObject::Constant(rhs.rows(), rhs.cols(), lhs) OP rhs; \
}
-#define EIGEN_MAKE_CWISE_COMP_R_OP(OP, R_OP, RCOMPARATOR) \
+#define EIGEN_MAKE_CWISE_COMP_R_OP(OP_NAME, R_OP, RCOMPARATOR) \
template<typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, const OtherDerived, const Derived> \
-OP(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
+OP_NAME(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const \
{ \
return CwiseBinaryOp<internal::scalar_cmp_op<typename OtherDerived::Scalar, Scalar, internal::cmp_##RCOMPARATOR>, const OtherDerived, const Derived>(other.derived(), derived()); \
} \
EIGEN_DEVICE_FUNC \
inline const RCmp ## RCOMPARATOR ## ReturnType \
-OP(const Scalar& s) const { \
- return Derived::PlainObject::Constant(rows(), cols(), s).R_OP(*this); \
+OP_NAME(const Scalar& s) const { \
+ return Derived::PlainObject::Constant(rows(), cols(), s) R_OP *this; \
} \
friend inline const Cmp ## RCOMPARATOR ## ReturnType \
-OP(const Scalar& s, const Derived& d) { \
- return d.R_OP(Derived::PlainObject::Constant(d.rows(), d.cols(), s)); \
+OP_NAME(const Scalar& s, const Derived& d) { \
+ return d R_OP Derived::PlainObject::Constant(d.rows(), d.cols(), s); \
}
@@ -175,7 +175,7 @@ OP(const Scalar& s, const Derived& d) { \
*
* \sa all(), any(), operator>(), operator<=()
*/
-EIGEN_MAKE_CWISE_COMP_OP(operator<, LT)
+EIGEN_MAKE_CWISE_COMP_OP(operator<, <, LT)
/** \returns an expression of the coefficient-wise \<= operator of *this and \a other
*
@@ -184,7 +184,7 @@ EIGEN_MAKE_CWISE_COMP_OP(operator<, LT)
*
* \sa all(), any(), operator>=(), operator<()
*/
-EIGEN_MAKE_CWISE_COMP_OP(operator<=, LE)
+EIGEN_MAKE_CWISE_COMP_OP(operator<=, <=, LE)
/** \returns an expression of the coefficient-wise \> operator of *this and \a other
*
@@ -193,7 +193,7 @@ EIGEN_MAKE_CWISE_COMP_OP(operator<=, LE)
*
* \sa all(), any(), operator>=(), operator<()
*/
-EIGEN_MAKE_CWISE_COMP_R_OP(operator>, operator<, LT)
+EIGEN_MAKE_CWISE_COMP_R_OP(operator>, <, LT)
/** \returns an expression of the coefficient-wise \>= operator of *this and \a other
*
@@ -202,7 +202,7 @@ EIGEN_MAKE_CWISE_COMP_R_OP(operator>, operator<, LT)
*
* \sa all(), any(), operator>(), operator<=()
*/
-EIGEN_MAKE_CWISE_COMP_R_OP(operator>=, operator<=, LE)
+EIGEN_MAKE_CWISE_COMP_R_OP(operator>=, <=, LE)
/** \returns an expression of the coefficient-wise == operator of *this and \a other
*
@@ -216,7 +216,7 @@ EIGEN_MAKE_CWISE_COMP_R_OP(operator>=, operator<=, LE)
*
* \sa all(), any(), isApprox(), isMuchSmallerThan()
*/
-EIGEN_MAKE_CWISE_COMP_OP(operator==, EQ)
+EIGEN_MAKE_CWISE_COMP_OP(operator==, ==, EQ)
/** \returns an expression of the coefficient-wise != operator of *this and \a other
*
@@ -230,7 +230,7 @@ EIGEN_MAKE_CWISE_COMP_OP(operator==, EQ)
*
* \sa all(), any(), isApprox(), isMuchSmallerThan()
*/
-EIGEN_MAKE_CWISE_COMP_OP(operator!=, NEQ)
+EIGEN_MAKE_CWISE_COMP_OP(operator!=, !=, NEQ)
#undef EIGEN_MAKE_CWISE_COMP_OP