Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

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

      From cppreference.com
      <cpp‎ |container‎ |mdspan‎ |extents
       
       
       
       
       
      staticconstexpr rank_type rank()constnoexcept;
      (since C++23)

      Returns the number of dimensions inextents.

      Contents

      [edit]Parameters

      (none)

      [edit]Return value

      The number of dimensions.

      [edit]Example

      Run this code
      #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';}

      Output:

      2, 3

      [edit]See also

      [static]
      returns the dynamic rank of anextents
      (public static member function)[edit]
      (C++11)
      obtains the number of dimensions of an array type
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/mdspan/extents/rank&oldid=157193"

      [8]ページ先頭

      ©2009-2026 Movatter.jp