std::extents<IndexType,Extents...>:: rank_dynamic
From cppreference.com
C++
Containers library
Sequence | ||||
(C++11)
|
||||
(C++26)
|
||||
(C++11)
|
||||
Associative | ||||
Unordered associative | ||||
(C++11)
|
||||
(C++11)
|
||||
(C++11)
|
||||
(C++11)
|
||||
Adaptors | ||||
(C++23)
|
||||
(C++23)
|
||||
(C++23)
|
||||
(C++23)
|
||||
Views | ||||
(C++20)
|
||||
(C++23)
|
||||
Tables | ||||
Iterator invalidation | ||||
Member function table | ||||
Non-member function table |
std::mdspan
|
std::extents
Member functions | ||||
Observers | ||||
extents::rank_dynamic
|
||||
Helpers | ||||
Non-member functions | ||||
Deduction guides |
static
constexpr
rank_type rank_dynamic
(
)
const
noexcept
;
|
(since C++23) | |
Returns the number of dynamic dimensions in
extents
.
Parameters
(none)
Return value
The number of dynamic dimensions.
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::extents<int, std::dynamic_extent, 7, std::dynamic_extent> e3(6, 8); std::cout << e1.rank_dynamic() << ", " << e2.rank_dynamic() << ", " << e3.rank_dynamic() << '\n'; }
Output:
0, 1, 2
See also
[static]
|
returns the static rank of an
extents
(public static member function) |
(C++11)
|
obtains the number of dimensions of an array type
(class template) |
Retrieved from "
https://en.cppreference.com/mwiki/index.php?title=cpp/container/mdspan/extents/rank_dynamic&oldid=157194
"