std::extents::rank_dynamic(3)
πΈ NAME πΈ
std::extents::rank_dynamic - std::extents::rank_dynamic
okay so this is the std::extents::rank_dynamic(3) page from the C++ Standard Libary manual β spelling exactly like the header had it, bestie, no cap. It's all about asking an extents object how many dynamic dimensions it has, and honestly? iconic. π
β¨ Synopsis β¨
static constexpr rank_type rank_dynamic() const noexcept;
β¨ (since C++23) β¨
This one returns the number of dynamic dimensions in extents. That's the whole flex. π«Ά
π Parameters π
(none) β literally none. Zero arguments, bestie. π
π Return value π
The number of dynamic dimensions. Slay. β¨
π¦ 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 π
rankβ returns the static rank of an extents;[static](public static member function)rankβ obtains the number of dimensions of an array type;(C++11)(class template)
That's the page, bestie. Source: http://cppreference.com, version/date: 2024.06.10, and the page itself is std::extents::rank_dynamic(3). Byeee πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms