std::extents::extent(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ¦‹ 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