namespace std {
template<class IndexType, size_t... Extents, class... Slices>
constexpr auto submdspan_canonicalize_slices(
const extents<IndexType, Extents...>& src, Slices... slices);
}
概要
多次元配列サイズextentsと各次元からの要素取り出し(スライス)情報を正規化する。
各次元からの要素取り出し方式は、submdspanを参照のこと。
submdspanスライス型
符号付きもしくは符号なし整数型IndexTypeに対して、下記のうち少なくとも1つを満たすとき、型SはIndexTypeのsubmdspanスライス型(submdspan slice type)となる。
is_convertible_v<S, full_extent_t>がtrueis_convertible_v<S, IndexType>がtrueSがstrided_sliceの特殊化であり、XがS::offset_type,S::extent_type,S::stride_typeを表すときis_convertible_v<X, IndexType>がいずれもtrue- 以下を全て満たす
- 型
Sのオブジェクトsに対して、宣言auto [...ls] = std::move(s);が有効 sizeof...(ls)が2に等しい(is_convertible_v<decltype(std::move(ls)), IndexType> && ...)がtrue
- 型
正則submdspanスライス型
符号付きもしくは符号なし整数型IndexTypeに対して、型SがIndexTypeもしくは値0以上の任意の値vを保持するconstant_wrapper<v>であるとき、型SはIndexTypeの正則submdspanインデクス型となる。
符号付きもしくは符号なし整数型IndexTypeに対して、下記のうちただ1つだけを満たすとき、型SはIndexTypeの正則submdspanスライス型(canonical submdspan slice type)となる。
Sがfull_extent_tSがIndexTypeの正則submdspanインデクス型であるSがstrided_sliceの特殊化であり、下記を全て満たすS::offset_type,S::extent_type,S::stride_typeが、全てIndexTypeの正則submdspanインデクス型であるS::stride_typeおよびS::extent_typeがいずれもconstant_wrapperの特殊化であり、S::stride_type::valueが0より大きい
縮約スライス型とMAP_RANK
ある型がfull_extent_tないしstrided_sliceの特殊化いずれでもないとき、縮約スライス型(collapsing slice type)となる。
パックpと整数iに対して、説明用のMAP_RANK(p, i)を0 <= j <のうち縮約スライス型ではない要素p...[j]の個数とする。
有効submdspanスライス型
extentsの特殊化である型Eに対して、型SがE::index_typeの正則スライス型であり、かつE::static_extent(k)に等しいxに対してxがdynamic_extentに等しいか下記を満たすとき、型SはEのk番目次元の有効submdspanスライス型(valid submdspan slice type)となる。
Sがstrided_sliceの特殊化であるとき :S::offset_typeがconstant_wrapperの特殊化であるとき、S::offset_type::valueがx以下S::extent_typeがconstant_wrapperの特殊化であるとき、S::extent_type::valueがx以下S::offset_typeおよびS::extent_typeがconstant_wrapperの特殊化であるとき、S::offset_type::value + S::extent_type::valueがx以下
Sがconstant_wrapperの特殊化であるとき、S::valueがxより小さい
有効submdspanスライス
extentsの特殊化である型Eのオブジェクトeと、型Sのオブジェクトsに対して、下記を満たすときsはeのk番目次元の有効submdspanスライス(valid submdspan slice)となる。
SがEのk番目次元の有効submdspanスライス型eのk番目区間が、eのk番目次元に対してsのsubmdspanスライス範囲を含むSがstrided_sliceの特殊化であるとき :s.extentが値0以上であり、かつs.extentsが値0に等しい、もしくはs.strideが値0より大きい
テンプレートパラメータ制約
sizeof...(SliceSpecifiers)がsizeof...(Extents)と等しいこと。
適格要件
srcの各次元インデクスkに対して、
SliceSpecifiers...[k]がIndexTypeのsubmdspanスライス型であり、かつdecltype(cannonical-slice<IndexType>(slices...[k]))がextents<IndexType, Extents...>のk番目次元の有効submdspanスライス型(validsubmdspanslice type)であること。
事前条件
srcの各次元インデクスkに対して、cannonical-slice<IndexType>(slices...[k])がsrcのk番目次元の有効submdspanスライス(valid submdspan slice)であること。
戻り値
make_tuple(canonical-slice<IndexType>(slices)...)
バージョン
言語
- C++26
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??