title: Invalid use of template-name ‘Matrix’ without an argument list
body: <p>Here is my Matrix.cpp file. (there's a separate Matrix.h file)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdexcept&gt;
  
  #include "Matrix.h"
  
  using namespace std;
  
  Matrix::Matrix&lt;T&gt;(int r, int c, T fill = 1)
  {
    if (r &gt; maxLength || c &gt; maxLength) {
      cerr &lt;&lt; "Number of rows and columns should not exceed " &lt;&lt; maxLen &lt;&lt; endl;
      throw 1;
    }
  
    if (r &lt; 0 || c &lt; 0) {
      cerr &lt;&lt; "The values for the number of rows and columns should be positive" &lt;&lt; endl;
      throw 2;
    }
  
    rows = r;
    cols = c;
  
    for (int i = 0; i &lt; rows; i++)
      for (int j = 0; j &lt; cols; j++)
        mat[i][j] = fill;
  
  }
  </code></pre>
  
  <p>This gives the following</p>
  
  <blockquote>
    <p>error: invalid use of template-name ‘Matrix’ without an argument list</p>
  </blockquote>
  
  <p>What's the problem in my code?</p>
  
  <p>EDIT: The class Matrix is defined with a <code>template&lt;class T&gt;</code></p>
  
  <p>EDIT:
  Here's my Matrix.h file:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;math.h&gt;
  
  #define maxLength 10;
  
  using namespace std;
  
  template &lt;class T&gt;
  
  class Matrix
  {
  public:
      Matrix(int r, int c, T fill = 1);
  
  private:
      int rows, cols;
          T mat[10][10];
  };
  </code></pre>
  
  <p>And here's the Matrix.cpp file:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdexcept&gt;
  
  #include "Matrix.h"
  
  using namespace std;
  
  template&lt;class T&gt;
  Matrix&lt;T&gt;::Matrix(int r, int c, T fill = 1)
  {
  }
  </code></pre>
  
  <p>This gives the following error:</p>
  
  <blockquote>
    <p>Matrix.cpp:12:43: error: default argument given for parameter 3 of
    ‘Matrix::Matrix(int, int, T)’ Matrix.h:16:3: error: after previous
    specification in ‘Matrix::Matrix(int, int, T)’</p>
  </blockquote>
  
  <p>What is wrong in my code?</p>