命名空间
变体
操作

std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>::size

来自 cppreference.cn
< cpp‎ | 容器‎ | mdspan
 
 
 
 
constexpr size_type size() const noexcept;
(C++23 起)

返回 mdspan 中的元素数量。

等价于 extents().fwd-prod-of-extents(rank())

多维索引空间 extents() 的大小必须能够用 size_type 类型的值表示。否则,行为是未定义的。

[编辑] 返回值

元素数量。

[编辑] 示例

[编辑] 参阅