Namespaces
Variants

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

From cppreference.net
constexpr size_type size ( ) const noexcept ;
(自 C++23 起)

返回 mdspan 中的元素数量。

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

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

返回值

元素数量。

示例

参见