std::extents,std::dextents(3)
πΈ NAME πΈ
Okay bestie, welcome to the std::extents,std::dextents(3) page from the C++ Standard Libary manual β yes, that's the spelling in the header, we're keeping it π. This whole page is about std::extents and std::dextents, and that's literally the name. No cap.
β¨ Synopsis β¨
Defined in header <mdspan>:
template< class IndexType, std::size_t... Extents > (1) (since C++23)
class extents;
template< class IndexType, std::size_t Rank > (2) (since C++23)
using dextents = /* see below */
- Represents a multidimensional index space of rank equal to
sizeof...(Extents). - A convenient alias template for an all-dynamic extents. Let
ddenotestd::dynamic_extent, each specialization of itdextents<IndexType, Rank>is equivalent toextents<IndexType /*, d, d, ..., d*/>(i.e.dis repeated a total ofRanktimes).
Each specialization of extents models regular and is TriviallyCopyable. Periodt. π
π Template parameters π
IndexTypeβ the type of each non-dynamicExtents. Shall be a signed or unsigned integer type. Otherwise, the program is ill-formed.Extentsβ represents extent (size of an integer interval) for each rank index. Each element of it is either equal tostd::dynamic_extent(in this case, it represents a dynamic extent and the extent size will be determined dynamically), or is representable as a value of typeIndexType(then it represents a static extent and the extent size is just the value of it), or else the program is ill-formed.Rankβ denotes the rank of an all-dynamic extents.
π¦ Member types π¦
index_typeβIndexTypesize_typeβstd::make_unsigned_t<index_type>rank_typeβstd::size_t
π Member objects π
dynamic-extents(private) β an array of typestd::array<index_type, rank_dynamic()>, which stores the size of each dynamic extents. (exposition-only member object*)
π Member functions π
constructorβ constructs anextents(public member function)
β Observers β
rank[static]β returns the static rank of anextents(public static member function)rank_dynamic[static]β returns the dynamic rank of anextents(public static member function)static_extent[static]β returns static extent size of anextentsat a certain rank index (public static member function)extentβ returns dynamic extent size of anextentsat a certain rank index (public member function)
π§ Helpers π§
fwd-prod-of-extentsβ returns the product of extent size in range[0, i)(exposition-only member function*)rev-prod-of-extentsβ returns the product of extents size in range[i + 1, rank())(exposition-only member function*)index-castβ casts the input into an integer type (exposition-only member function*)dynamic-index(private) β returns the number of dynamic extents below a certain rank index (exposition-only member function*)dynamic-index-inv(private) β returns the numberrsuch that in range[0, r + 1)there is exactlyi + 1dynamic extents for a certain argumenti(exposition-only member function*)
π₯ Non-member functions π₯
operator==(C++23) β compare underlying extents in each dimension of two extents (function)
π Deduction guides(C++23) π
This one is just listed on the page as Deduction guides(C++23) β no extra details here, bestie. That's the whole vibe check. π
π Example π
This section is incomplete Reason: no example
π See also π
rank(C++11) β obtains the number of dimensions of an array type (class template)extent(C++11) β obtains the size of an array type along a specified dimension (class template)
π Category π
- Todo no example
Source/version/date sign-off:http://cppreference.comΒ·2024.06.10Β·std::extents,std::dextents(3)β love u, bye bestie πβ¨
π¦ 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