Spec-Zone.ru › C++

std::layout_left::mapping<Extents>::operator()

template< class... Indices >
constexpr index_type operator()( Indices... indices ) const noexcept;
(начиная с C++23)

Отображает многомерный индекс indices в значение смещения.

Эквивалентно return ((static_cast<index_type>(indices) * stride(P)) + ... + 0);, где P — набор, такой что std::is_same_v<std::index_sequence_for<Indices...>, std::index_sequence<P...>> является true.

Эта перегрузка участвует в разрешении перегрузки только в том случае, если:

  • sizeof...(Indices) == extents_type​::​rank() является true,
  • (std::is_convertible_v<Indices, index_type> && ...) является true, и
  • (std::is_nothrow_constructible_v<index_type, Indices> && ...) является true.

Если extents_type​::index-cast(i) не является многомерным индексом в extents(), поведение не определено.

Параметры

indices - многомерный индекс в объекте underlying extents

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

Значение смещения.

Пример

См. также

operator()
отображает многомерный индекс в значение смещения
(открытая функция-член std::layout_right::mapping<Extents>)
operator()
отображает многомерный индекс в значение смещения
(открытая функция-член std::layout_stride::mapping<Extents>)
operator[]
обращается к элементу по указанному многомерному индексу
(открытая функция-член std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/container/mdspan/layout_left/mapping/operator()

Spec-Zone.ru

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