diff --git a/include/seqan3/utility/simd/views/to_simd.hpp b/include/seqan3/utility/simd/views/to_simd.hpp index d5339555d3..086fd06dd7 100644 --- a/include/seqan3/utility/simd/views/to_simd.hpp +++ b/include/seqan3/utility/simd/views/to_simd.hpp @@ -69,7 +69,7 @@ class view_to_simd : public std::ranges::view_interface; //!< The inner range type. + using inner_range_type = std::ranges::range_reference_t; //!< The inner range type. using chunk_type = std::array::length>; //!< The underlying type to hold the chunks. using scalar_type = typename simd_traits::scalar_type; //!< The scalar type. //!\brief The SIMD type with maximal number of lanes for the current arch. diff --git a/test/unit/utility/simd/views/to_simd_test.cpp b/test/unit/utility/simd/views/to_simd_test.cpp index 464f7206a1..ffc5d3ecdc 100644 --- a/test/unit/utility/simd/views/to_simd_test.cpp +++ b/test/unit/utility/simd/views/to_simd_test.cpp @@ -356,3 +356,17 @@ TYPED_TEST(view_to_simd_test, issue_1941) EXPECT_TRUE((std::common_with)); } + +TYPED_TEST(view_to_simd_test, const_sequences) +{ + using simd_t = typename TestFixture::simd_t; + + auto v = std::as_const(this->sequences) | seqan3::views::to_simd; + this->compare(v, this->transformed_simd_vec); + + if constexpr (seqan3::simd::simd_traits::length > 1) + { + EXPECT_EQ(v.empty(), false); + EXPECT_EQ(v.size(), 64u); + } +}