libtcod
Loading...
Searching...
No Matches
tcod::MatrixView< T, Dimensions > Class Template Reference

A view into a strided multi-dimensional array. More...

#include <matrix.hpp>

Public Types

using size_type = int
 
using shape_type = std::array<size_type, Dimensions>
 
using stride_type = std::array<size_type, Dimensions>
 
using index_type = std::array<size_type, Dimensions>
 
using reference = T&
 
using const_reference = const T&
 

Public Member Functions

constexpr MatrixView ()=default
 Default constructor.
 
constexpr MatrixView (const shape_type &shape_xy, const stride_type &strides_xy, T *data) noexcept
 Create a new multi-dimensional view.
 
constexpr reference operator[] (const index_type &index) noexcept
 Get the item at index.
 
constexpr const_reference operator[] (const index_type &index) const noexcept
 Get the const item at index.
 
constexpr reference at (const index_type &index)
 Get the item at index, checking bounds.
 
constexpr const_reference at (const index_type &index) const
 Get the const item at index, checking bounds.
 
constexpr bool in_bounds (const index_type &index) const noexcept
 Return true if index is within the bounds of this matrix.
 

Detailed Description

template<typename T, size_t Dimensions>
class tcod::MatrixView< T, Dimensions >

A view into a strided multi-dimensional array.

Template Parameters
TThe type viewed by this object.
DimensionsThe number of dimensions of the view.

This class is a work-in-progress.


The documentation for this class was generated from the following file: