friend ostream& operator<<(ostream& output, const Matrix& matrix)

Error 2 error C2662: 'Matrix<T>::YDim' : cannot convert 'this' pointer from 'const Matrix<T>' to 'Matrix<T> &'

I seem to get the same error for all of the functions I'm defining with a const Matrix& matrix, but when I remove the const it works fine.

Thanks in advance!