std::extents::rank_dynamic(3)

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

🌸 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