std::layout_left::mapping(3)

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

πŸ’… std::layout_left::mapping(3) β€” C++ Standard Libary πŸ’…

🌸 NAME 🌸

std::layout_left::mapping β€” std::layout_left::mapping


✨ Synopsis ✨

Defined in header <mdspan>
template< class Extents >    (since C++23)
class layout_left::mapping;

Okay so the class template layout_left::mapping controls how multidimensional indices are mapped in a column-major manner to a one-dimensional value representing the offset. The mapping has stride 1 at leftmost extent and strides increase left-to-right as the products of extents. It’s giving column-major main character energy, no cap. πŸ”₯

Every specialization of mapping is a LayoutMapping and a TriviallyCopyable type which satisfies regular. πŸ’–

🚨 Heads up, bestie: the program is ill-formed if the size of the multidimensional index space Extents() is not representable as a value of type Extents::index_type when Extents::rank_dynamic() is 0. That’s a hard error, fr fr. πŸ’€

🧚 Template parameters 🧚

  • Extents β€” specifies number of dimensions, their sizes, and which are known at compile time. Must be a specialization of std::extents.

πŸ‘‘ Member types πŸ‘‘

Member type β†’ definition, slay:

  • extents_type β€” Extents
  • index_type β€” extents_type::index_type
  • size_type β€” extents_type::size_type
  • rank_type β€” extents_type::rank_type
  • layout_type β€” std::layout_left

πŸŽ€ Member objects πŸŽ€

  • extents_ (private) β€” The extents of type extents_type. (exposition-only member object*)

πŸ¦‹ Member functions πŸ¦‹

  • constructor β€” constructs a new mapping (public member function)
  • operator= β€” assigns a mapping (public member function)

πŸ”₯ Observers πŸ”₯

  • extents β€” obtains the extents object (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)

πŸ’œ Non-member functions πŸ’œ

  • operator== β€” compares this layout mapping with other mapping (function template)
  • submdspan_mapping(std::layout_left::mapping) (C++26) β€” calculates the mapping and data handle offset used for subdmspan (public member function)

🌈 See also 🌈

  • mapping β€” a layout mapping of layout_right (public member class template of std::layout_right)
  • mapping β€” a layout mapping of layout_stride (public member class template of std::layout_stride)

Source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::layout_left::mapping(3). Byeee, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from