命名空间
变体
操作

std::layout_right::mapping

来自 cppreference.cn
< cpp‎ | container‎ | mdspan‎ | layout right
 
 
 
 
 
定义于头文件 <mdspan>
template< class Extents >
class layout_right::mapping;
(since C++23)

类模板 layout_right::mapping 控制如何以行优先方式将多维索引映射到表示偏移量的一维值。此映射在最右侧维度的步幅为 1,步幅从右到左增加,为各维度的范围的乘积。

mapping 的每个特化都是 LayoutMappingTriviallyCopyable 类型,并满足 regular

如果多维索引空间 Extents() 的大小不能表示为 Extents::index_type 类型的值,且当 Extents::rank_dynamic()0 时,程序是非良构的。

内容

[编辑] 模板参数

Extents - 指定维度数量、维度大小以及哪些在编译时已知。必须是 std::extents 的特化。

[编辑] 成员类型

成员名称 定义
extents_type Extents
index_type extents_type::index_type
size_type extents_type::size_type
rank_type extents_type::rank_type
layout_type std::layout_right

[编辑] 数据成员

成员 定义
extents_type extents_ (private) extents 对象
(仅为说明目的的成员对象*)

[编辑] 成员函数

构造新的 mapping
(public member function) [编辑]
operator=
(显式预置)
赋值 mapping
(public member function) [编辑]
观察器
获取 extents 对象
(public member function) [编辑]
返回 mapping 的所需大小
(public member function) [编辑]
将多维索引映射为偏移值
(public member function) [编辑]
[静态]
确定此 mapping 是否是唯一的(每种索引组合都映射到不同的底层元素)
(public static member function) [编辑]
确定此 mapping 是否是完备的(每个底层元素都可以通过某种索引组合访问)
(public static member function) [编辑]
[静态]
确定此 mapping 是否是步进的(在每个维度中,每次递增索引都会跳过相同数量的底层元素)
(public static member function) [编辑]
确定此布局映射是否始终唯一
(public static member function) [编辑]
确定此布局映射是否始终完备
(public static member function) [编辑]
确定此布局映射是否始终步进
(public static member function) [编辑]
获取沿指定维度的步幅
(public member function) [编辑]

[编辑] 非成员函数

layout_right 的此布局映射与其他 mapping 进行比较
(function template) [编辑]
计算用于 subdmspan 的 mapping 和数据句柄偏移量
(public member function) [编辑]

[编辑] 示例

[编辑] 参见

layout_left 的布局映射
(public member class template of std::layout_left)[编辑]
layout_stride 的布局映射
(public member class template of std::layout_stride)[编辑]