Alright, i have starred at this for sometime, and while i could try every combination of const modifier, I would rather get an explanation why this won't go. I still get hung up on const stuff...
I get the following error on compile:Code:Matrix& Matrix::operator = (const Matrix& m) { if (*this == m) { for (int r = 0; r < rows(); r++) { for (int c = 0; c < cols(); c++) { (*this)(r,c) = m(r,c); } } return *this; } else { throw std::invalid_argument("Error! Matricies must be equal for assignment."); } }
Thanks in advance!error C2662: 'cols' : cannot convert 'this' pointer from 'const class Matrix' to 'class Matrix &'
Conversion loses qualifiers
error C2662: 'rows' : cannot convert 'this' pointer from 'const class Matrix' to 'class Matrix &'
Conversion loses qualifiers




Reply With Quote