std::layout_stride::mapping<Extents>::operator()
From cppreference.com
< cpp | container | mdspan | layout stride | mapping
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::layout_stride::mapping
mapping::operator()
template< class... Indices >
constexpr index_type operator()( Indices... indices ) const noexcept;
(since C++23)
constexpr index_type operator()( Indices... indices ) const noexcept;
Maps the multidimensional index indices into an offset value.
Equivalent to return ((static_cast<index_type>(indices) * stride(P)) + ... + 0); where P is a pack such that std::is_same_v <std::index_sequence_for <Indices...>, std::index_sequence <P...>> is true.
This overload participates in overload resolution only if :
- sizeof...(Indices) == extents_type::rank() is true,
- (std::is_convertible_v <Indices, index_type> && ...) is true, and
- (std::is_nothrow_constructible_v <index_type, Indices> && ...) is true.
If extents_type::index-cast (i) is not a multidimensional index in extents(), the behavior is undefined.
Contents
[edit] Parameters
indices
-
the multidimensional index in the underlying extents object
[edit] Return value
The offset value.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example
[edit] See also
maps a multidimensional index into an offset value
(public member function of
(public member function of
std::layout_left::mapping<Extents>
) [edit]
maps a multidimensional index into an offset value
(public member function of
(public member function of
std::layout_right::mapping<Extents>
) [edit]
accesses an element at the specified multidimensional index
(public member function of
(public member function of
std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>
) [edit]