Spec-Zone.ru › C++

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

template< class OtherIndexType >
static constexpr auto /*index-cast*/( OtherIndexType&& i ) noexcept;
(since C++23)
(exposition only*)

Преобразует индекс i типа OtherIndexType в определённый целочисленный тип. Эквивалентно:

  • return i;, если OtherIndexType — целочисленный тип, отличный от bool, и
  • return static_cast<index_type>(i); в противном случае.

Параметры

i - индекс для преобразования

Возвращаемое значение

Преобразованный индекс.

Примечания

Пример

См. также

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/container/mdspan/extents/index-cast

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API