std::extents<IndexType,Extents...>::extents
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Containers library
(C++17)
(C++11)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++23)
(C++23)
(C++20)
(C++23)
Tables
std::mdspan
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
std::extents
extents::extents
constexpr extents() = default;
(1)
(since C++23)
template< class OtherIndexType, std::size_t... OtherExtents >
(2)
(since C++23)
constexpr explicit(/*see below*/)
template< class... OtherIndexTypes >
constexpr explicit extents( OtherIndexTypes... exts ) noexcept;
(3)
(since C++23)
constexpr explicit extents( OtherIndexTypes... exts ) noexcept;
template< class OtherIndexType, std::size_t N >
(4)
(since C++23)
constexpr explicit(N != rank_dynamic())
template< class OtherIndexType, std::size_t N >
(5)
(since C++23)
constexpr explicit(N != rank_dynamic())
Construct an extents
. One can construct extents
from just dynamic extents, which are all the values getting stored, or from all the extents with a precondition.
1) Default constructor. Initializes all dynamic extents to zero.
2) Conversion from another
extents
object. After construction, *this == other is true.
- 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.
[edit] Parameters
other
-
another
extents
to convert from
exts
-
represents the extents
[edit] Example
This section is incomplete
Reason: no example
Reason: no example
[edit] See also
This section is incomplete