7#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_SUBMDSPAN_EXTENTS_HPP_
8#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_MDSPAN_SUBMDSPAN_EXTENTS_HPP_
12#include "arene/base/mdspan/detail/canonical_slice.hpp"
13#include "arene/base/mdspan/detail/mandate_each_argtype_is_submdspan_slice.hpp"
14#include "arene/base/mdspan/detail/map_rank.hpp"
15#include "arene/base/mdspan/detail/to_array.hpp"
21#include "arene/base/stdlib_choice/cstddef.hpp"
22#include "arene/base/stdlib_choice/enable_if.hpp"
23#include "arene/base/stdlib_choice/forward.hpp"
24#include "arene/base/stdlib_choice/integer_sequence.hpp"
25#include "arene/base/stdlib_choice/integral_constant.hpp"
26#include "arene/base/stdlib_choice/move.hpp"
27#include "arene/base/stdlib_choice/tuple.hpp"
28#include "arene/base/stdlib_choice/tuple_element.hpp"
29#include "arene/base/tuple/detail/get.hpp"
30#include "arene/base/tuple/detail/tuple_transform.hpp"
38namespace submdspan_extents_detail {
56template <
std::size_t... Is,
class Tuple,
class LiftedInverseMapping>
58 -> std::tuple<std::tuple_element_t<LiftedInverseMapping::value[Is], Tuple>...> {
59 return std::tuple<std::tuple_element_t<LiftedInverseMapping::value[Is], Tuple>...>{
77template <
class Tuple,
class LiftedInverseMapping>
78constexpr auto filter(Tuple tuple, LiftedInverseMapping)
noexcept
79 ->
decltype(filter_impl(
82 LiftedInverseMapping{}
87 LiftedInverseMapping{}
100class submdspan_extents_fn {
102 class extent_from_slice {
111 template <
class IndexType,
class Offset,
class Extent,
class Str
ide>
112 constexpr auto operator()(IndexType
const&, extent_slice<Offset, Extent, Stride> slice)
const noexcept
121 template <
class IndexType>
122 constexpr auto operator()(IndexType
const& ext, full_extent_t)
const noexcept -> IndexType {
179 class... SliceSpecifiers,
181 std::nullptr_t = mdspan_detail::mandate_each_argtype_is_submdspan_slice<IndexType, SliceSpecifiers...>()
183 constexpr auto operator()(extents<IndexType, Extents...>
const& src, SliceSpecifiers... slices)
const noexcept(
185 decltype(submdspan_canonicalize_slices),
186 extents<IndexType, Extents...>
const& ,
187 SliceSpecifiers&&...>
192 constexpr auto lifted_inverse_mapping = std::integral_constant<
193 decltype((mdspan_detail::inverse_map_rank<mdspan_detail::canonical_slice_t<IndexType, SliceSpecifiers>...>)),
194 mdspan_detail::inverse_map_rank<mdspan_detail::canonical_slice_t<IndexType, SliceSpecifiers>...>>{};
202 tuple_detail::tuple_transform_to_array<IndexType>(
203 filter(mdspan_detail::to_array(src), lifted_inverse_mapping),
204 filter(submdspan_canonicalize_slices(src,
std::move(slices)...), lifted_inverse_mapping),
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
arene::base::type_lists:: flat_map< L0, arene::base::type_lists::filter_detail::apply_filter< Filter >::template filter > filter
Filter a type-list to remove elements that don't match the supplied Filter.
Definition filter.hpp:61
Definition accumulate.hpp:37
constexpr std::integral_constant< std::size_t, N > array< T, N >::size
Definition array.hpp:534
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
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
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition accumulate.hpp:36
typedef nullptr_t
The type of nullptr.
Definition cstddef.hpp:33
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
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
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24