std::extents::extents(3)
NAME π
std::extents::extents - std::extents::extents
okay so bestie, this is the std::extents::extents(3) page from the C++ Standard Libary, and we are gonna get you comfy with every constructor, no cap. β¨
Synopsis πΈ
(1) (since C++23)
constexpr extents() = default;
(2) (since C++23)
template< class OtherIndexType, std::size_t... OtherExtents >
constexpr explicit(/*see below*/)
extents( const std::extents<OtherIndexType, OtherExtents...>&
other ) noexcept;
(3) (since C++23)
template< class... OtherIndexTypes >
constexpr explicit extents( OtherIndexTypes... exts ) noexcept;
(4) (since C++23)
template< class OtherIndexType, std::size_t N >
constexpr explicit(N != rank_dynamic())
extents( std::span<OtherIndexType, N> exts ) noexcept;
(5) (since C++23)
template< class OtherIndexType, std::size_t N >
constexpr explicit(N != rank_dynamic())
extents( const std::array<OtherIndexType, N>& exts ) noexcept;
Construct an extents. You can construct extents from just the dynamic extents β those are literally all the values that get stored β or from all the extents with a precondition. That's the vibe. π¦
- Default constructor. Initializes all dynamic extents to zero. Zero, zip, zilch, iconic. π
- Conversion from another
extentsobject. After construction,*this == otheris true. Slay.- The behavior is undefined if:
other.extent(r) != static_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, orother.extent(r)is not representable as a value of typeIndexTypefor any rank valuerinother.
- This overload participates in overload resolution only if:
sizeof...(OtherExtents) == rank()is true, and((OtherExtents == std::dynamic_extent || Extents == std::dynamic_extent || OtherExtents == Extents) && ...)is true.
- This constructor is
explicitif:((Extents != std::dynamic_extent && OtherExtents == std::dynamic_extent) || ...)is true, orstd::numeric_limits<IndexType>::max() < std::numeric_limits<OtherIndexType>::max()is true.
- The behavior is undefined if:
- Let
Nbesizeof...(exts)andexts_arrbestd::array<IndexType, N>{static_cast<IndexType>(std::move(exts))...}, equivalent toextents(exts_arr).- This overload participates in overload resolution only if:
(std::is_convertible_v<OtherIndexTypes, IndexType> && ...)is true,(std::is_nothrow_constructible_v<IndexType, OtherIndexTypes> && ...)is true, andN == rank_dynamic() || N == rank()is true.
- The behavior is undefined if:
N != rank_dynamic()andexts_arr[r]is not equal tostatic_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, or- an element in
extsis negative or not representable as a value of typeIndexType. 4, 5. IfNequalsrank_dynamic(), for alldin[0, rank_dynamic()), direct-non-list-initializesdynamic-extents[d]withstd::as_const(exts[d]). Otherwise, for alldin[0, rank_dynamic()), direct-non-list-initializesdynamic-extents[d]withstd::as_const(exts[dynamic-index-inv(d)]).
- This overload participates in overload resolution only if:
std::is_convertible_v<const OtherIndexType&, IndexType>is true,std::is_nothrow_constructible_v<IndexType, const OtherIndexType&>is true, andN == rank_dynamic() || N == rank()is true.
- The behavior is undefined if:
N != rank_dynamic()andexts[r]is not equal tostatic_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, orexts[r]is negative or not representable as a value of typeIndexTypefor any rank indexr.
- This overload participates in overload resolution only if:
Parameters π«Ά
otherβ anotherextentsto convert from.extsβ represents the extents.
Example π
This section is incomplete
Reason: no example
See also π
This section is incomplete
Categories π
- Todo no example
- Todo without reason
mwah π this page came from http://cppreference.com, version/date 2024.06.10, and it's the std::extents::extents(3) page β go forth and construct, 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