generic matrix template
This commit is contained in:
parent
223c486c92
commit
8eff3208fc
8
m.cpp
8
m.cpp
|
@ -1,4 +1,4 @@
|
||||||
template<class T, unsigned ... RestD> struct Matrix;
|
template<class T, unsigned ... RestDim> struct Matrix;
|
||||||
|
|
||||||
template<class T, unsigned FirstDim >
|
template<class T, unsigned FirstDim >
|
||||||
struct Matrix<T, FirstDim> {
|
struct Matrix<T, FirstDim> {
|
||||||
|
@ -8,9 +8,9 @@ struct Matrix<T, FirstDim> {
|
||||||
inline T& operator[](unsigned i) { return data[i]; }
|
inline T& operator[](unsigned i) { return data[i]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T, unsigned FirstDim, unsigned ... RestD >
|
template<class T, unsigned FirstDim, unsigned ... RestDim >
|
||||||
struct Matrix<T, FirstDim, RestD...> {
|
struct Matrix<T, FirstDim, RestDim...> {
|
||||||
typedef typename Matrix<T, RestD...>::GenericDimType FirstDimType;
|
typedef typename Matrix<T, RestDim...>::GenericDimType FirstDimType;
|
||||||
typedef FirstDimType GenericDimType[FirstDim];
|
typedef FirstDimType GenericDimType[FirstDim];
|
||||||
|
|
||||||
GenericDimType data;
|
GenericDimType data;
|
||||||
|
|
Loading…
Reference in New Issue