From feaafda30a7d1617fef37e284802a5d66325f2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Thu, 22 Feb 2024 22:52:25 +0000 Subject: [PATCH] Change array_size result from enum to constexpr. --- Eigen/src/Core/util/EmulateArray.h | 8 ++++---- Eigen/src/Core/util/Meta.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Eigen/src/Core/util/EmulateArray.h b/Eigen/src/Core/util/EmulateArray.h index 2b1155245..4bfbbbab0 100644 --- a/Eigen/src/Core/util/EmulateArray.h +++ b/Eigen/src/Core/util/EmulateArray.h @@ -204,19 +204,19 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T& array_get(const array& a) { template struct array_size > { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size&> { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size > { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size&> { - enum { value = N }; + static constexpr Index value = N; }; } // end namespace internal diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 859d2f18d..d2336ce5d 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -303,30 +303,30 @@ class noncopyable { */ template struct array_size { - enum { value = Dynamic }; + static constexpr Index value = Dynamic; }; template struct array_size> { - enum { value = T::SizeAtCompileTime }; + static constexpr Index value = T::SizeAtCompileTime; }; template struct array_size { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size> { - enum { value = N }; + static constexpr Index value = N; }; template struct array_size> { - enum { value = N }; + static constexpr Index value = N; }; /** \internal