From fb2131f63e33b22686f440ddd9ddea34b9748d2f Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Sat, 12 Oct 2024 18:40:58 +0900 Subject: [PATCH] fix: to_array should not modify std::array --- common/src/KokkosFFT_utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/KokkosFFT_utils.hpp b/common/src/KokkosFFT_utils.hpp index 937863c0..684c94f5 100644 --- a/common/src/KokkosFFT_utils.hpp +++ b/common/src/KokkosFFT_utils.hpp @@ -217,7 +217,7 @@ Layout create_layout(const std::array& extents) { template constexpr Kokkos::Array to_array_lvalue_helper( - std::array& a, std::index_sequence) { + const std::array& a, std::index_sequence) { return {{a[Is]...}}; } template @@ -227,7 +227,7 @@ constexpr Kokkos::Array to_array_rvalue_helper( } template -constexpr Kokkos::Array to_array(std::array& a) { +constexpr Kokkos::Array to_array(const std::array& a) { return to_array_lvalue_helper(a, std::make_index_sequence()); } template