std::extents<IndexType,Extents...>:: index-cast
From cppreference.net
C++
Containers library
|
(C++17)
|
||||
| Sequence | ||||
|
(C++11)
|
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
|
(C++11)
|
||||
| Associative | ||||
| Unordered associative | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Adaptors | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| Views | ||||
|
(C++20)
|
||||
|
(C++23)
|
||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
std::mdspan
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::extents
| Member functions | ||||
| Observers | ||||
| Helpers | ||||
|
extents::
index-cast
|
||||
| Non-member functions | ||||
| Deduction guides |
|
template
<
class
OtherIndexType
>
static constexpr auto /*index-cast*/ ( OtherIndexType && i ) noexcept ; |
(C++23부터)
( 설명 전용* ) |
|
인덱스
i
를
OtherIndexType
타입에서 특정 정수 타입으로 캐스팅합니다.
다음과 동일합니다:
-
return
i
;
, 만약
OtherIndexType이 bool 을 제외한 정수형 타입인 경우 - return static_cast < index_type > ( i ) ; 그 외의 경우.
매개변수
| i | - | 캐스팅할 인덱스 |
반환값
캐스트 인덱스.
참고 사항
이 함수에 대한 호출은 항상
bool
이 아닌 정수형을 반환합니다.
정수 클래스 타입
은 정밀도 손실 없이
static_cast
분기를 사용할 수 있습니다. 왜냐하면 이 함수의 호출 지점들은 이미
OtherIndexType
가
index_type
으로 변환 가능하다는 제약 조건을 가지고 있기 때문입니다.