最終更新日時(UTC):
が更新

履歴 編集

function template
<mdspan>

std::layout_right_padded::mapping::submdspan_mapping(C++26)

template<class... SliceSpecifiers>
constexpr auto submdspan-mapping-impl(  // exposition only
  SliceSpecifiers ... slices) const -> see below;

template<class... SliceSpecifiers>
friend constexpr auto submdspan_mapping(
  const mapping& src, SliceSpecifiers... slices)
{
  return src.submdspan-mapping-impl(slices...);
}

概要

submdspan関数をサポートするためのカスタマイゼーションポイント。

説明用の型index_typeExtents::index_type、型S_kSliceSpecifiersk番目の型とする。

テンプレートパラメータ制約

sizeof...(slices)Extents::rank()と等しいこと。

適格要件

extents()の各次元インデクスkにおいて、下記いずれかのうち1つだけを満たすこと。

事前条件

extents()の各次元インデクスkにおいて、s_kslicesk番目の値としたとき、下記を全て満たすこと。

  • S_kstrided_sliceの特殊化のとき
    • s_k.extent == 0、または
    • s_k.stride > 0
  • 0first_<index_type, k>(slices...)last_<k>(extents(), slices...)extents().extent(k)

戻り値

説明用の値や型を次の通り定義する。

下記を満たす型Sを、単位ストライド幅スライス(unit-stride slice)と定義する。

説明専用のsubmdspan-mapping-impl関数テンプレートは下記の値を返す。

  • Extents::rank() == 0のとき、submdspan_mapping_result{*this, 0}
  • rank_ == 1またはSubExtents::rank() == 0のとき、submdspan_mapping_result{layout_right::mapping(sub_ext), offset}
  • 以下を満たすとき、submdspan_mapping_result{layout_right::mapping(sub_ext), offset}
    • SubExtents::rank() == 1、かつ
    • rank_-1に等しい値kに対して、型S_kが単位ストライド幅スライスである
  • 以下を満たすとき、submdspan_mapping_result{layout_right_padded<S_static>::mapping(sub_ext, stride(rank_-u-2)), offset}
    • S_pが単位ストライド幅スライスを満たすrank_-1より小さい最大値pに対して、rank_-u-2pとなる値uを用いて
      • rank_-1に等しい値kに対して、型S_kが単位ストライド幅スライスであり、かつ
      • 半開区間[rank_-SubExtents::rank()-u+1, rank_-u-1)の値kに対して、is_convertible_v<S_k, full_extent_t>、かつ
      • rank_-SubExtents::rank()-uに等しい値kに対して、型S_kが単位ストライド幅スライスである
    • ここで定数S_static
      • 半開区間[rank_-u-1, rank_-1)のいずれかの値kに対してstatic_extent(k)dynamic_extentのとき、dynamic_extent
      • そうでなければ、半開区間[rank_-u-1, rank_-1)の全ての値kに対してstatic_extent(k)を乗算した値
  • submdspan_mapping_result{layout_stride::mapping(sub_ext, sub_strides), offset}

バージョン

言語

  • C++26

処理系

関連項目

参照