>>109885265
in c++ that's just
template<typename T, int width, int height>
class Mat : public std::array<T, width*height>{
public:
T& operator()(const int row, const int col){
return std::array<T, width*height>::operator[](width*row+col);
}
const T& operator()(const int row, const int col) const {
return std::array<T, width*height>::operator[](width*row+col);
}
void fill(const T value){
std::array<T, width*height>::fill(value);
}
};