I have a templated Matrix class with some templated functions that operate on them, including a function for producing identity matrices:
template<typename T, int iSize, int jSize>
Matrix<T, iSize, iSize> identity(const T& identity)
{
Matrix<T, iSize, iSize> m;
for(int i = 0; i < iSize; ++i)
m.set(i, i, identity);
return m;
}
I have some typdefs for common matrix sizes and types:
typedef Matrix<int, 4, 4> Matrix44i;
typedef Matrix<float, 4, 4> Matrix44f;
Is it possible to create some sort of alias to identity<int, 4, 4>(1) so I can refer to it as identity44i?