Since you can't use [][] to access a matrix you are suggested to use () operator instead.
However a limitation of that is you can't assign:which forces us to write such statements as:Code:m[col][row] = x; // valid m(col, row) = x; // invalidIs there any way of working around that limitation so you can useCode:m[( col * cols ) + row] = rhs( col, row );which is more elegant?Code:m( col, row ) = rhs( col, row );
It's mainly an academic exercise as I've finished the matrix class and just having a wonder over lunch.




Reply With Quote