名稱空間
變體
操作

std::layout_right::mapping<Extents>::operator()

來自 cppreference.com
< cpp‎ | 容器‎ | mdspan‎ | layout_right‎ | 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

此過載僅在以下條件為真時參與過載決議:

如果 extents_type​::index-cast(i) 不是 extents() 中的多維索引,則行為未定義。

目錄

[編輯] 引數

indices - 底層 extents 物件中的多維索引

[編輯] 返回值

偏移值。

[編輯] 示例

[編輯] 參閱

將多維索引對映到偏移量值
(std::layout_left::mapping<Extents> 的公有成員函式) [編輯]
將多維索引對映到偏移量值
(std::layout_stride::mapping<Extents> 的公有成員函式) [編輯]
訪問指定多維索引處的元素
(std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy> 的公有成員函式) [編輯]