std::layout_stride::mapping<Extents>:: operator()
From cppreference.com
< cpp | container | mdspan | layout stride | mapping
| template< class... Indices > constexpr index_type operator()( Indices... indices ) const noexcept; |
(C++23から) | |
多次元インデックス indices をオフセット値にマッピングします。
次と同等です: return ((static_cast<index_type>(indices) * stride(P)) + ... + 0); ここで P は、 std::is_same_v<std::index_sequence_for<Indices...>, std::index_sequence<P...>> が true であるようなパックです。
このオーバーロードは、以下の条件が満たされる場合にのみオーバーロード解決に参加します。
- sizeof...(Indices) == extents_type::rank() が true であり、
- (std::is_convertible_v<Indices, index_type> && ...) が true であり、かつ
- (std::is_nothrow_constructible_v<index_type, Indices> && ...) が true である。
extents_type::index-cast(i) が extents() における多次元インデックスでない場合、動作は未定義です。
目次 |
[編集] パラメータ
| indices | - | 基になる extents オブジェクトにおける多次元インデックス |
[編集] 戻り値
オフセット値。
[編集] 例
| このセクションは未完成です 理由: 例がありません |
[編集] 関連項目
| 多次元インデックスをオフセット値にマッピングします。 ( std::layout_left::mapping<Extents> の public メンバ関数) [編集] | |
| 多次元インデックスをオフセット値にマッピングします。 ( std::layout_right::mapping<Extents> の public メンバ関数) [編集] | |
| 指定された多次元インデックスの要素にアクセスする ( std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy> の public メンバ関数) |