std::layout_right::mapping<Extents>:: operator()
|
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>
的公开成员函数)
|
|
|
将多维索引映射为偏移值
(
std::layout_stride::mapping<Extents>
的公开成员函数)
|
|
|
访问指定多维索引处的元素
(
std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>
的公开成员函数)
|