std::extents<IndexType,Extents...>::index-cast
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::index-cast
template< class OtherIndexType >
static constexpr auto /*index-cast*/( OtherIndexType&& i ) noexcept;
(since C++23) static constexpr auto /*index-cast*/( OtherIndexType&& i ) noexcept;
(exposition only*)
Casts the index i of type OtherIndexType
into a certain integral type.
It is equivalent to:
- return i;, if
OtherIndexType
is an integral type other than bool and - return static_cast<index_type>(i); otherwise.
[edit] Parameters
i
-
the index to be cast
[edit] Return value
Cast index.
[edit] Notes
A call to this function will always return an integral type other than bool. Integer-class types can use the static_cast branch without loss of precision because this function's call sites are already constrained on the convertibility of OtherIndexType
to index_type
.