diff --git a/include/xtensor/containers/xstorage.hpp b/include/xtensor/containers/xstorage.hpp index efeb6571e..26d4a8ccd 100644 --- a/include/xtensor/containers/xstorage.hpp +++ b/include/xtensor/containers/xstorage.hpp @@ -1640,6 +1640,16 @@ namespace xt return m_array.cend(); } + auto crbegin() const + { + return m_array.crbegin(); + } + + auto crend() const + { + return m_array.crend(); + } + constexpr std::size_t operator[](std::size_t idx) const { return m_array[idx]; diff --git a/test/test_xfixed.cpp b/test/test_xfixed.cpp index b4af22af2..3a6e8181b 100644 --- a/test/test_xfixed.cpp +++ b/test/test_xfixed.cpp @@ -22,6 +22,7 @@ #include "xtensor/core/xnoalias.hpp" #include "xtensor/io/xio.hpp" #include "xtensor/misc/xmanipulation.hpp" +#include "xtensor/views/xview.hpp" #include "test_common_macros.hpp" @@ -306,6 +307,13 @@ namespace xt using tiny_tensor = xtensor_fixed, layout_type::row_major, false>; EXPECT_GT(sizeof(fixed_tensor), sizeof(tiny_tensor)); } + + TEST(xtensor_fixed, iterators) + { + auto arr = xt::xtensor({5, 5, 5, 5, 5}); + auto fixed_arr = xt::xtensor_fixed>{1, 2, 3}; + xt::view(arr, xt::range(0, 3)) = fixed_arr + 1; + } } #endif