title: How to create overloading + on the other side
body: <p>I have matrix class and overloaded operator + working with other matrices and scalars. When I try to use it like mat2=mat+3; that works ok but if i change scalar and matrix mat2=3+mat; it says "Invalid operands to binary expression('int' and Matrix&lt;3, 4>')" (3,4 is rows and columns in this matrix).
  How I understand I haven't overloaded + for this cases but I don't find how to overload it</p>
  
  <pre><code>Matrix operator+(const T &amp;a) {
      Matrix&lt;row, col, T&gt; result;
      for (int i = 0; i &lt; row; ++i) {
          for (int j = 0; j &lt; col; ++j) {
              result.elements[i][j] = elements[i][j] + a;
          }
  
      }
      return result;
  }
  </code></pre>