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/is_valid_submdspan_slice_type_for.hpp"
11#include "arene/base/mdspan/detail/map_rank.hpp"
12#include "arene/base/mdspan/extents.hpp"
13#include "arene/base/mdspan/full_extent.hpp"
14#include "arene/base/mdspan/slice.hpp"
15#include "arene/base/stdlib_choice/cstddef.hpp"
16#include "arene/base/stdlib_choice/integer_sequence.hpp"
17#include "arene/base/type_list/at.hpp"
18#include "arene/base/type_list/type_list.hpp"
19#include "arene/base/type_traits/all_of.hpp"
26namespace submdspan_subextents_type_detail {
34static constexpr auto subextents_static_extent_for(std::size_t
const e_k, full_extent_t
const&)
noexcept
44template <
class Offset,
class Extent,
class Stride>
45static constexpr auto subextents_static_extent_for(
47 extent_slice<Offset, Extent, Stride>
const&
48)
noexcept -> std::size_t {
49 return mdspan_detail::deduced_static_extent_v<Extent>;
58template <
class Extents,
class... CanonicalSliceSpecifiers>
59class submdspan_subextents_type_impl;
66template <
class IndexType, std::size_t... Extents,
class... CanonicalSliceSpecifiers>
67class submdspan_subextents_type_impl<extents<IndexType, Extents...>, CanonicalSliceSpecifiers...> {
69 all_of_v<mdspan_detail::is_valid_submdspan_slice_type_for_v<CanonicalSliceSpecifiers, Extents>...>,
70 "each type in 'SliceSpecifiers' must be a valid 'submdspan' slice type for the associated extent"
75 static constexpr auto const& inverse_map_rank = mdspan_detail::inverse_map_rank<CanonicalSliceSpecifiers...>;
81 template <std::size_t... Is>
82 static auto impl(std::index_sequence<Is...>) -> extents<
84 subextents_static_extent_for(
85 extents<IndexType, Extents...>::static_extent(inverse_map_rank[Is]),
86 type_lists::at_t<type_list<CanonicalSliceSpecifiers...>, inverse_map_rank[Is]>{}
91 using type =
decltype(impl(std::make_index_sequence<inverse_map_rank.size()>{}));
110template <
class Extents,
class... SliceSpecifiers>
120template <
class Extents,
class... SliceSpecifiers>
determines the subextents type from an extents type and slice specifiers
Definition submdspan_subextents_type.hpp:114
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10