17 using size_type = std::size_t;
19 using const_reference =
const T&;
21 using const_pointer =
const T*;
23 ArrayView(pointer data,
const Shape& shape,
const Shape& strides)
30 const Shape& shape()
const noexcept
36 const Shape& strides()
const noexcept
42 size_type ndim()
const noexcept
48 size_type size()
const noexcept
50 return shape_.elements();
54 pointer data()
noexcept
60 const_pointer data()
const noexcept
65 template<
typename... Rest>
66 requires ((std::is_integral_v<Rest>) && ...)
67 reference operator()(size_type first, Rest... rest)
69 const std::array<size_type,
sizeof...(Rest) + 1> indices{
71 static_cast<size_type
>(rest)...
74 return data_[indexing::offset(strides_, indices)];
77 template<
typename... Rest>
78 requires ((std::is_integral_v<Rest>) && ...)
79 const_reference operator()(size_type first, Rest... rest)
const
81 const std::array<size_type,
sizeof...(Rest) + 1> indices{
83 static_cast<size_type
>(rest)...
86 return data_[indexing::offset(strides_, indices)];