Namespaces
Variants

std::extents<IndexType,Extents...>:: rank

From cppreference.net
static constexpr rank_type rank ( ) const noexcept ;
(C++23부터)

extents 의 차원 수를 반환합니다.

목차

매개변수

(없음)

반환값

차원의 수.

예제

#include <iostream>
#include <mdspan>
int main()
{
    std::extents<int, 1, 2> e1;
    std::extents<int, 3, 4, std::dynamic_extent> e2(5);
    std::cout << e1.rank() << ", " << e2.rank() << '\n';
}

출력:

2, 3

참고 항목

extents 의 동적 랭크를 반환합니다
(public static member function)
(C++11)
배열 타입의 차원 수를 구합니다
(class template)