5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_SUBMDSPAN_SUBEXTENTS_TYPE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_SUBMDSPAN_SUBEXTENTS_TYPE_HPP_
8#include "arene/base/mdspan/detail/canonical_slice.hpp"
9#include "arene/base/mdspan/detail/deduced_static_extent.hpp"
10#include "arene/base/mdspan/detail/mandate_each_argtype_is_valid_submdspan_slice_type_for.hpp"
11#include "arene/base/mdspan/detail/map_rank.hpp"
15#include "arene/base/stdlib_choice/cstddef.hpp"
16#include "arene/base/stdlib_choice/integer_sequence.hpp"
25namespace submdspan_subextents_type_detail {
33static constexpr auto subextents_static_extent_for(
std::size_t const e_k, full_extent_t
const&)
noexcept
43template <
class Offset,
class Extent,
class Str
ide>
44static constexpr auto subextents_static_extent_for(
46 extent_slice<Offset, Extent, Stride>
const&
48 return mdspan_detail::deduced_static_extent_v<Extent>;
57template <
class Extents,
class... CanonicalSliceSpecifiers>
58class submdspan_subextents_type_impl;
65template <
class IndexType,
std::size_t... Extents,
class... CanonicalSliceSpecifiers>
66class submdspan_subextents_type_impl<extents<IndexType, Extents...>, CanonicalSliceSpecifiers...> {
69 (mdspan_detail::mandate_each_argtype_is_valid_submdspan_slice_type_for<IndexType, Extents...>(
70 type_list<CanonicalSliceSpecifiers...>{}
73 "This assertion always succeeds, but writing it causes other assertions to happen in the called function"
78 static constexpr auto const& inverse_map_rank = mdspan_detail::inverse_map_rank<CanonicalSliceSpecifiers...>;
87 subextents_static_extent_for(
88 extents<IndexType, Extents...>::static_extent(inverse_map_rank[Is]),
89 type_lists::at_t<type_list<CanonicalSliceSpecifiers...>, inverse_map_rank[Is]>{}
113template <
class Extents,
class... SliceSpecifiers>
115 :
public submdspan_subextents_type_detail::submdspan_subextents_type_impl<
117 mdspan_detail::canonical_slice_t<typename Extents::index_type, SliceSpecifiers>...> {};
123template <
class Extents,
class... SliceSpecifiers>
determines the subextents type from an extents type and slice specifiers
Definition submdspan_subextents_type.hpp:117
typename at< L0, Index >::type at_t
Get the n-th element from a type list.
Definition at.hpp:113
Definition accumulate.hpp:37
typename submdspan_subextents_type< Extents, SliceSpecifiers... >::type submdspan_subextents_type_t
determines the subextents type from an extents type and slice specifiers
Definition submdspan_subextents_type.hpp:124
Definition accumulate.hpp:36
make_integer_sequence< size_t, Size > make_index_sequence
A helper alias template for make_integer_sequence<size_t, Size>
Definition integer_sequence.hpp:224
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29