#include "tensorstore/array.h"
template <typename Element, Index N0>
ArrayView<Element, 1>
tensorstore::MakeArrayView(Element (&array)[N0]);
template <typename Element, Index N0>
ArrayView<const Element, 1>
tensorstore::MakeArrayView(const Element (&array)[N0]);
template <typename Element, Index N0, Index N1>
ArrayView<Element, 2>
tensorstore::MakeArrayView(Element (&array)[N0][N1]);
template <typename Element, Index N0, Index N1>
ArrayView<const Element, 2>
tensorstore::MakeArrayView(const Element (&array)[N0][N1]);

Returns an ArrayView that points to the specified C array.

Note

Only the rank-1 and rank-2 overloads are shown, but C arrays with up to 6 dimensions are supported.

Parameters:
Element (&array)[N0]
const Element (&array)[N0]
Element (&array)[N0][N1]
const Element (&array)[N0][N1]

The C array to which the returned ArrayView will point. May be specified as a (nested) braced list, e.g. MakeArrayView({{1, 2, 3}, {4, 5, 6}}), in which case the inferred Element type will be const-qualified.

Warning

The caller is responsible for ensuring that the returned array is not used after array becomes invalid.