Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1 KB

File metadata and controls

62 lines (44 loc) · 1 KB

rank

  • mdspan[meta header]
  • function[meta id-type]
  • std[meta namespace]
  • mdspan[meta class]
  • cpp23[meta cpp]
static constexpr rank_type rank() noexcept;

概要

多次元配列サイズの次元数を取得する。

戻り値

extents_type::rank()

例外

投げない

#include <cassert>
#include <mdspan>

int main()
{
  int arr[] = {1, 2, 3, 4, 5, 6};
  // 静的要素数 2x3 の2次元配列ビュー
  std::mdspan<int, std::extents<size_t, 2, 3>> mat{arr};

  static_assert(mat.rank() == 2);
}
  • rank()[color ff0000]

出力

バージョン

言語

  • C++23

処理系

関連項目

参照