index::operator Operator

Returns the component of the index as the specified location.

int operator[] (
   unsigned _Index                     
) const restrict(amp,cpu);
                     
int& operator[] (
   unsigned _Index                     
) restrict(amp,cpu);

Parameters

  • _Index
    An integer from 0 through the rank minus 1.

Return Value

The element that's at the specified index.

Remarks

This following example displays the component values of the index.

// Prints 1 2 3.
concurrency::index<3> idx(1, 2, 3);
std::cout << idx[0] << "\n";
std::cout << idx[1] << "\n";
std::cout << idx[2] << "\n";

Requirements

Header: amp.h

Namespace: Concurrency

See Also

Reference

index Class