5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_EXTENTS_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_EXTENTS_HPP_
9#include "arene/base/array/array.hpp"
10#include "arene/base/compiler_support/cpp14_inline.hpp"
11#include "arene/base/constraints/constraints.hpp"
12#include "arene/base/detail/dynamic_extent.hpp"
13#include "arene/base/functional/not_fn.hpp"
14#include "arene/base/mdspan/detail/deduced_static_extent.hpp"
15#include "arene/base/mdspan/detail/extent_sequence.hpp"
16#include "arene/base/mdspan/detail/extract_dynamic_extents_for.hpp"
17#include "arene/base/mdspan/detail/to_array.hpp"
18#include "arene/base/span/span.hpp"
19#include "arene/base/stdlib_choice/cstddef.hpp"
20#include "arene/base/stdlib_choice/enable_if.hpp"
21#include "arene/base/stdlib_choice/forward.hpp"
22#include "arene/base/stdlib_choice/integer_sequence.hpp"
23#include "arene/base/stdlib_choice/integral_constant.hpp"
24#include "arene/base/stdlib_choice/is_constructible.hpp"
25#include "arene/base/stdlib_choice/is_convertible.hpp"
26#include "arene/base/stdlib_choice/is_integral.hpp"
27#include "arene/base/stdlib_choice/is_same.hpp"
28#include "arene/base/stdlib_choice/make_unsigned.hpp"
29#include "arene/base/stdlib_choice/move.hpp"
30#include "arene/base/stdlib_choice/numeric_limits.hpp"
31#include "arene/base/type_traits/all_of.hpp"
32#include "arene/base/type_traits/remove_cvref.hpp"
33#include "arene/base/utility/safe_comparisons.hpp"
39namespace extents_detail {
51template <
class IndexType, std::size_t... Extents>
52static constexpr bool valid_extents_template_parameters_v{
54 std::is_integral<IndexType>::value &&
55 !std::is_same<IndexType,
bool>::value &&
56 all_of_v<((Extents == dynamic_extent) || cmp_less_equal(Extents, std::numeric_limits<IndexType>::max()))...>};
68template <
typename IndexType, std::size_t... Extents>
81 constexpr auto dynamic_extents()
const noexcept -> dynamic_extents_storage_type
const&
83 return static_cast<dynamic_extents_storage_type
const&>(*
this);
90 template <
class OtherIndexType,
class OtherExtentSequence>
91 static constexpr bool copy_from_other_extents_is_explicit_v{
102 extents_detail::valid_extents_template_parameters_v<IndexType, Extents...>,
103 "invalid template parameters for 'extents'"
108 using index_type = IndexType;
368namespace extents_detail {
374template <
class IndexType,
class IndexSequence>
375class dextents_helper {};
381template <
class IndexType, std::size_t... Is>
382class dextents_helper<IndexType, std::index_sequence<Is...>> {
385 using type = extents<IndexType, (
static_cast<
void>(Is), dynamic_extent)...>;
395template <
class IndexType, std::size_t Rank>
396class dextents_helper<IndexType, std::integral_constant<std::size_t, Rank>>
397 :
public dextents_helper<IndexType, std::make_index_sequence<Rank>> {};
424namespace extents_detail {
441 template <
typename... Integrals>
444 constexpr auto operator()(Integrals&&... extents_values)
const noexcept
445 -> arene::base::extents<std::size_t, mdspan_detail::deduced_static_extent_v<remove_cvref_t<Integrals>>...> {
446 return arene::base::extents<std::size_t, mdspan_detail::deduced_static_extent_v<remove_cvref_t<Integrals>>...>(
447 std::forward<Integrals>(extents_values)...
represents a multidimensional index space
Definition extents.hpp:72
Definition array_exceptions_disabled.cpp:11
ARENE_CPP14_INLINE_VARIABLE(extents_detail::make_extents_fn, make_extents)
constexpr bool is_extents_v
Helper variable to check if a provided type is an instantiation of extents.
constexpr bool is_extents_v< extents< IndexType, Extents... > >
Helper variable to check if a provided type is an instantiation of extents.
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10