std::layout_right::mapping(3)
π NAME π
okay so bestie, this is the std::layout_right::mapping(3) page from the C++ Standard Libary manual, and the name situation is literally:
std::layout_right::mapping - std::layout_right::mapping
Periodt. Thatβs the whole NAME vibe. π
π¦ Synopsis π¦
First things first, bestie β itβs defined in header <mdspan>, and itβs been around since C++23. Hereβs the exact code energy:
Defined in header <mdspan>
template< class Extents > (since C++23)
class layout_right::mapping;
okay so what does this icon actually do? The class template layout_right::mapping controls how multidimensional indices are mapped in a row-major manner to a one-dimensional value representing the offset. The mapping has stride 1 at rightmost extent and strides increase right-to-left as the products of extents. no cap, thatβs the whole mapping moment. π
Every specialization of mapping is a LayoutMapping and a TriviallyCopyable type which satisfies regular. itβs giving very well-behaved, tbh. π«Ά
β οΈ and this part is serious: the program is ill-formed if the size of the multidimensional index spaceExtents()is not representable as a value of typeExtents::index_typewhenExtents::rank_dynamic()is0. not a vibe, fr fr. π
π Template parameters π
Extentsβ specifies the number of dimensions, their sizes, and which are known at compile time. Must be a specialization ofstd::extents. π§
πΈ Member types πΈ
extents_typeβExtentsindex_typeβextents_type::index_typesize_typeβextents_type::size_typerank_typeβextents_type::rank_typelayout_typeβstd::layout_right
π Member objects π
extents_(private) β the extents of typeextents_type. (exposition-only member object*)
π Member functions π
- constructor β constructs a new
mapping(public member function). operator=β assigns amapping(public member function).
β¨ Observers β¨
extentsβ obtains theextentsobject (public member function).required_span_sizeβ returns the required size of the mapping (public member function).operator()β maps multidimensional indices into an offset value (public member function).is_unique[static] β determines if this mapping is unique (every combination of indexes maps to a different underlying element) (public static member function).is_exhaustive[static] β determines if this mapping is exhaustive (every underlying element can be accessed with some combination of indexes) (public static member function).is_strided[static] β determines if this mapping is unique (every combination of indexes maps to a different underlying element) (public static member function).is_always_unique[static] β determines if this layout mapping is always unique (public static member function).is_always_exhaustive[static] β determines if this layout mapping is always exhaustive (public static member function).is_always_strided[static] β determines if this layout mapping is always strided (public static member function).strideβ obtains the stride along the specified dimension (public member function).
π lowkey note: for is_strided, the page literally uses the same βuniqueβ wording as above β Iβm keeping it exactly as written, no editing, iykyk.
π₯ Non-member functions π₯
operator==β compares this layout mapping with other mapping (function template).submdspan_mapping(std::layout_right::mapping)(C++26) β calculates the mapping and data handle offset used forsubdmspan(public member function).
π¦ See also π¦
mappinga layout mapping oflayout_left(public member class template ofstd::layout_left)mappinga layout mapping oflayout_stride(public member class template ofstd::layout_stride)
thatβs the whole page, bestie π«Ά source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::layout_right::mapping(3) πβ¨
π¦ 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