diff --git a/Eigen/src/Core/functors/TernaryFunctors.h b/Eigen/src/Core/functors/TernaryFunctors.h index 745779a13..82095f1d2 100644 --- a/Eigen/src/Core/functors/TernaryFunctors.h +++ b/Eigen/src/Core/functors/TernaryFunctors.h @@ -21,7 +21,8 @@ namespace internal { template struct scalar_boolean_select_op { - static constexpr bool ThenElseAreSame = is_same::value; + static constexpr bool ThenElseAreSame = + is_same, std::remove_const_t>::value; EIGEN_STATIC_ASSERT(ThenElseAreSame, THEN AND ELSE MUST BE SAME TYPE) using Scalar = ThenScalar; using result_type = Scalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h index f6bdc50e0..6c81d53ca 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h @@ -789,7 +789,7 @@ struct TensorEvaluator template = true> EIGEN_DEVICE_FUNC PacketReturnType packet(Index index) const { - Scalar arr[PacketSize]; + std::remove_const_t arr[PacketSize]; EIGEN_UNROLL_LOOP for (Index i = 0; i < PacketSize; ++i) { arr[i] = m_condImpl.coeff(index + i) ? Scalar(-1) : Scalar(0);