std::extents::extents(3)

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

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. πŸ¦‹

  1. Default constructor. Initializes all dynamic extents to zero. Zero, zip, zilch, iconic. πŸ’…
  2. Conversion from another extents object. After construction, *this == other is true. Slay.
    • The behavior is undefined if:
      • other.extent(r) != static_extent(r) for any r for which static_extent(r) represents a static extent, or
      • other.extent(r) is not representable as a value of type IndexType for any rank value r in other.
    • 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 explicit if:
      • ((Extents != std::dynamic_extent && OtherExtents == std::dynamic_extent) || ...) is true, or
      • std::numeric_limits<IndexType>::max() < std::numeric_limits<OtherIndexType>::max() is true.
  3. Let N be sizeof...(exts) and exts_arr be std::array<IndexType, N>{static_cast<IndexType>(std::move(exts))...}, equivalent to extents(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, and
      • N == rank_dynamic() || N == rank() is true.
    • The behavior is undefined if:
      • N != rank_dynamic() and exts_arr[r] is not equal to static_extent(r) for any r for which static_extent(r) represents a static extent, or
      • an element in exts is negative or not representable as a value of type IndexType. 4, 5. If N equals rank_dynamic(), for all d in [0, rank_dynamic()), direct-non-list-initializes dynamic-extents[d] with std::as_const(exts[d]). Otherwise, for all d in [0, rank_dynamic()), direct-non-list-initializes dynamic-extents[d] with std::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, and
      • N == rank_dynamic() || N == rank() is true.
    • The behavior is undefined if:
      • N != rank_dynamic() and exts[r] is not equal to static_extent(r) for any r for which static_extent(r) represents a static extent, or
      • exts[r] is negative or not representable as a value of type IndexType for any rank index r.

Parameters 🫢

  • other β€” another extents to 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