From 5c2179b6c30921d1c5ed5d6762be1f0e0e14493d Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 23 May 2022 17:36:03 +0000 Subject: [PATCH] Avoid ambiguous Tensor comparison operators for C++20 compatibility --- .../Eigen/CXX11/src/Tensor/TensorBase.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 3e07a6f99..abe8db2a3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -519,36 +519,36 @@ class TensorBase } // Comparisons and tests. - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator<(const OtherDerived& other) const { + operator<(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator<=(const OtherDerived& other) const { + operator<=(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator>(const OtherDerived& other) const { + operator>(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator>=(const OtherDerived& other) const { + operator>=(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator==(const OtherDerived& other) const { + operator==(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); } - template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp, const Derived, const OtherDerived> - operator!=(const OtherDerived& other) const { + operator!=(const TensorBase& other) const { return binaryExpr(other.derived(), internal::scalar_cmp_op()); }