Compilation error : No match for overloaded operator <p>here is a part of my code, when i compile it, it says 1: no match for operator = 2: no known conversion for argument 1 from 'Matrix' to 'Matrix&amp;' but if i remove the operator + part it works where is the problem?! :|</p> <p>gcc errors: "no match for 'operator=' in 'z = Matrix::operator+(Matrix&amp;)((* &amp; y))' candidate is: atrix&amp; Matrix::operator=(Matrix&amp;) no known conversion for argument 1 from 'Matrix' to 'Matrix&amp;' "</p> <pre><code>class Matrix { //friend list: friend istream&amp; operator&gt;&gt;(istream&amp; in, Matrix&amp; m); friend ostream&amp; operator&lt;&lt;(ostream&amp; in, Matrix&amp; m); int** a; //2D array pointer int R, C; //num of rows and columns static int s1, s2, s3, s4, s5; public: Matrix(); Matrix(const Matrix&amp;); ~Matrix(); static void log(); Matrix operator+ (Matrix &amp;M){ if( R == M.R &amp;&amp; C == M.C ){ s4++; Matrix temp; temp.R = R; temp.C = C; temp.a = new int*[R]; for(int i=0; i&lt;R; i++) temp.a[i] = new int[C]; for(int i=0; i&lt;R; i++) for(int j=0; j&lt;C; j++) temp.a[i][j] = a[i][j] + M.a[i][j]; return temp; } } Matrix&amp; operator = (Matrix&amp; M){ s5++; if(a != NULL) { for(int i=0; i&lt;R; i++) delete [] a[i]; delete a; a = NULL; R = 0; C = 0; } R = M.R; C = M.C; a = new int*[R]; for(int i=0; i&lt;R; i++) a[i] = new int[C]; for(int i=0; i&lt;R; i++) for(int j=0; j&lt;C; j++) a[i][j] = M.a[i][j]; return *this; } </code></pre> <p>};</p>