generic matrix template

This commit is contained in:
hladu357 2024-05-21 18:33:24 +02:00
parent 223c486c92
commit 8eff3208fc
1 changed files with 4 additions and 4 deletions

8
m.cpp
View File

@ -1,4 +1,4 @@
template<class T, unsigned ... RestD> struct Matrix;
template<class T, unsigned ... RestDim> struct Matrix;
template<class T, unsigned FirstDim >
struct Matrix<T, FirstDim> {
@ -8,9 +8,9 @@ struct Matrix<T, FirstDim> {
inline T& operator[](unsigned i) { return data[i]; }
};
template<class T, unsigned FirstDim, unsigned ... RestD >
struct Matrix<T, FirstDim, RestD...> {
typedef typename Matrix<T, RestD...>::GenericDimType FirstDimType;
template<class T, unsigned FirstDim, unsigned ... RestDim >
struct Matrix<T, FirstDim, RestDim...> {
typedef typename Matrix<T, RestDim...>::GenericDimType FirstDimType;
typedef FirstDimType GenericDimType[FirstDim];
GenericDimType data;