std::layout_right(3)

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

πŸ’… std::layout_right β€” the C++ Standard Library, bestie edition

Okay so this is the std::layout_right page from the C++ Standard Library manual, section 3. Pull up a chair, we're getting into layout mappings and honestly? It's giving foundational. ✨


🌸 NAME 🌸

std::layout_right β€” literally just std::layout_right, that's the whole name, no notes πŸ’€


✨ Synopsis ✨

First thing's first, she lives in a header, as all icons do:

Defined in header <mdspan>

And here's the actual declaration, character for character:

struct layout_right;        (since C++23)
🫢 Quick vibe check: this thing has been around since C++23, so if your compiler is being weird about it, that's why, no cap.

πŸŽ€ DESCRIPTION πŸŽ€

So layout_right is a LayoutMappingPolicy and a trivial type β€” yes bestie, both β€” and what she does is provide a layout mapping where the rightmost extent has stride 1, and the strides increase right-to-left as the product of extents. That's the whole personality. πŸ¦‹

And listen β€” she's not just some random policy, she's the default layout mapping policy used by std::mdspan if no user-specified layout is provided. Main character energy fr. πŸ‘‘


🌈 Member class templates 🌈

  • mapping β€” a layout mapping of layout_right, and it's a public member class template πŸ’–

⭐ See also ⭐

  • layout_left (C++23) β€” column-major multidimensional array layout mapping policy; leftmost extent has stride 1 (class) 🌸
  • layout_stride (C++23) β€” a layout mapping policy with user-defined strides (class) πŸ”₯

That's the whole page, periodt. πŸ’…

Source and version, for the record: http://cppreference.com, 2024.06.10, and the page signature is std::layout_right(3). Mwah, go slay your mdspan. πŸ§šπŸ’œ

πŸ“¦ where this page comes from