std::extents<IndexType,Extents...>::rank
From cppreference.com
| 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
[編集] 関連項目
| [static] |
extents の動的ランクを返します。(public static member function) |
| (C++11) |
配列型の次元数を取得する (クラステンプレート) |