Template Class Array2DView

Class Documentation

template<typename T>
class Array2DView

Lightweight non-owning view of 2D array data.

Public Functions

inline T *data() noexcept

Return pointer to the data.

inline const T *data() const noexcept

Return const pointer to the data.

inline int extent(int dim) const noexcept

Return the array extent in each dimension.

inline int size() const noexcept

Return the total size of the array.

inline T &operator()(int i0, int i1) const noexcept

Return reference to the element at the given indices.

inline T &operator[](int idx) const noexcept

Return reference to the element at the given linear index.

Array2DView(const Array2DView&) noexcept = default
Array2DView &operator=(const Array2DView&) noexcept = default