Visible to Intel only — GUID: GUID-9D4B0875-D129-4377-AA5A-6E93C839D840
Visible to Intel only — GUID: GUID-9D4B0875-D129-4377-AA5A-6E93C839D840
index_d template function
template<int DimensionT, typename ObjT>
auto index_d(const ObjT &a_obj)
The template function offers a consistent way to determine the index of a dimension for a multi-dimensional object. It can avoid extracting an entire n_index_t<…> when only the extent of a single dimension is needed.
Template Argument | Description |
---|---|
int DimensionT |
0 based index starting at the leftmost dimension indicating which n-dimensions to query the index of. Requirements: DimensionT >=0 and DimensionT < ObjT::rank |
typename ObjT |
The type of n-dimensional object from which to retrieve the extent. Requirements: ObtT is one of: n_index_t<…> n_index_generator<…> |
Returns
The correctly typed index corresponding to the requested DimensionT of a_obj.
Example
template <typename IndicesT>
void foo(const IndicesT & a_pos)
{
int z = index_d<0>(a_pos);
int y = index_d<1>(a_pos);
int x = index_d<2>(a_pos);
/…
}