title: Error using template type parameter
body: <p>I am having some trouble compiling a template class. I believe I am constructing the skeleton correctly, but the compiler disagrees with me. I was hoping someone could take a look at this and point me in the right direction as to where I am going wrong. </p>
  
  <pre><code>// default constructor, construct an empty heap
  template&lt;class T, int MAX_SIZE&gt;
  PQueue&lt;class T, int MAX_SIZE&gt;::PQueue() {
      buildHeap();
  }
  </code></pre>
  
  <p>I am doing this the same way everywhere else and these are the errors I'm getting:</p>
  
  <pre><code>PQueue.cpp:14:14: error: using template type parameter ‘T’ after ‘class’
   PQueue&lt;class T, int MAX_SIZE&gt;::PQueue() {
                ^
  PQueue.cpp:14:29: error: template argument 1 is invalid
   PQueue&lt;class T, int MAX_SIZE&gt;::PQueue() {
                               ^
  PQueue.cpp:14:29: error: template argument 2 is invalid
  PQueue.cpp:14:39: error: declaration of template ‘template&lt;class T, int MAX_SIZE&gt; int PQueue()’
   PQueue&lt;class T, int MAX_SIZE&gt;::PQueue() {
  </code></pre>
  
  <p>Just for reference this is my header file which I think is fine:</p>
  
  <pre><code>#ifndef PRIORITY_QUEUE_H
  #define PRIORITY_QUEUE_H
  
  #include &lt;iostream&gt;
  using namespace std;
  
  // Minimal Priority Queue implemented with a binary heap
  // Stores item of type T
  template&lt; class T, int MAX_SIZE &gt;
  class PQueue{
  public:
      PQueue(); // default constructor, construct an empty heap
      PQueue(T* items, int size); // construct a heap from an array of elements
      void insert(T); // insert an item; duplicates are allowed.
      T findMin(); // return the smallest item from the queue
      void deleteMin(); // remove the smallest item from the queue
      bool isEmpty(); // test if the priority queue is logically empty
      int size(); // return queue size
  private:
      int _size; // number of queue elements
      T _array[MAX_SIZE]; // the heap array, items are stoed starting at index 1
      void buildHeap(); // linear heap construction
      void moveDown(int); // move down element at given index
      void moveUp(); // move up the last element in the heap array
  };
  
  #include "PQueue.cpp"
  
  #endif
  </code></pre>