Closed shen-cs closed 7 years ago
So there's two options; you can either fix the size of the matrix and declare it as Matrix<3,3> _R; for example. Or you can make your class a template class as well and pass the size in as a template parameter. You can read up on template classes here: http://www.cplusplus.com/doc/oldtutorial/templates/
Hello,
I'm writing a class with
Matrix
class as constructor parameters. Some of functions of this class also returnMatrix
. I triedMatrix<int, int>
andMatrix<int, int, class, class>
as data type to return in my function but both of them didn't work.Here's the error message:
error: type/value mismatch at argument 1 in template parameter list for 'template<int rows, int cols, class ElemT, class MemT> class Matrix' Matrix<int, int, class, class> _R;