Namespaces
Variants

std::extents<IndexType,Extents...>:: index-cast

From cppreference.net
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 으로 변환 가능하다는 제약 조건을 가지고 있기 때문입니다.