std::extents::extent(3)
π¦ std::extents::extent(3) β C++ Standard Libary, bestie π
okay so welcome to the std::extents::extent page, no cap. This is the one that gives you the dynamic extent size at a rank index, and she is literally serving. π
πΈ NAME πΈ
std::extents::extent β yes bestie, it's literally std::extents::extent. That's the whole name. Iconic behavior. β¨
β¨ Synopsis β¨
Here's the signature, and she's constexpr + noexcept, since C++23:
constexpr index_type extent( rank_type i ) const noexcept; (since C++23)
She returns the dynamic extent size of an extents at a certain rank index. Periodt. π
π Parameters π
iβ the rank index to get the extent size of. Like, you point at the rank and she tells you the dynamic extent size. π«Ά
πΈ Return value πΈ
The dynamic extent size of an extents at a certain rank index. That's the tea. π
π Example π
Run this code, bestie β it's giving main character energy:
// Run this code
#include <iostream>
#include <mdspan>
int main()
{
std::extents<int, 1, 2> e1;
std::extents<int, 3, std::dynamic_extent, std::dynamic_extent>
e2(4, 5);
std::cout << e1.extent(0) << ", " << e1.extent(1) << '\n';
std::cout << e2.extent(0) << ", " << e2.extent(1) << ", " <<
e2.extent(2) << '\n';
}
β Output β
1, 2
3, 4, 5
π See also π
static_extentβ returns static extent size of an extents at a certain rank index.[static](public static member function) β¨extentβ obtains the size of an array type along a specified dimension.(C++11)(class template) π«
π source/version: http://cppreference.com Β· date: 2024.06.10 Β· for std::extents::extent(3) β mwah, bestie! π«Άβ¨
π¦ 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