std::layout_right(3)
π 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 oflayout_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
- 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