title: c++ template class error when referencing implementation of class from inside the header file
body: <p>Edit: I fixed it after restarting everything from scratch. I'm not sure what caused the issue. If anyone has any idea, or insight what was causing the main issue, I'll edit the first post with the follow up.</p>
  
  <p>so I'm doing a homework assignment to create a heap class that utilizes a template to be able to use both numerical data, and strings. The compiler I'm using is visual studio 2010</p>
  
  <p>The header file looks like this..</p>
  
  <pre><code>#ifndef HEAP_H
  #define HEAP_H
  
  #include &lt;iostream&gt;
  #include &lt;vector&gt;       // not needed if you use a static array
  
  using std::cout;
  using std::endl;
  using std::vector;
  template &lt;typename type&gt;
  class Heap {
  ... the method headers I have to implement in the Heap.template file
  };
  #include "Heap.template"
  
  #endif
  </code></pre>
  
  <p>The Heap.template file is where we're supposed to implement the methods of the heap. However, I cannot compile without being slaughtered by errors. Here's the first method supplied by the instructor himself: </p>
  
  <pre><code>template &lt;typename type&gt;
  Heap&lt;type&gt;::Heap(bool maxheap) {
  // this default constructor supports a dynamic array. In this array, the root
  // of the heap begins at index 1; the variable "dummy" is used to fill the 
  // zero position of the dynamic array.  
  type dummy;
    this-&gt;maxheap = maxheap;
    heap.push_back(dummy);
    size = heap.size()-1;
  }
  </code></pre>
  
  <p>Even if I comment out the rest of the methods that I've implemented, I'm still presented with the errors</p>
  
  <pre><code>error C2143: syntax error : missing ';' before '&lt;'
  error C4430: missing type specifier - int assumed. Note: C++ does not support default-     int
  error C2988: unrecognizable template declaration/definition
  error C2059: syntax error : '&lt;'
  </code></pre>
  
  <p>on line the</p>
  
  <pre><code>Heap&lt;type&gt;::Heap(bool maxheap) {
  </code></pre>
  
  <p>These same set of errors exist for every single method I try to implement in the supplied .template file, for instance this print method</p>
  
  <pre><code>template &lt;typename type&gt;
  void Heap&lt;type&gt;::PrintHeap()
  {
  for( std::vector&lt;type&gt;::iterator i = heap.begin(); i != heap.end(); ++i)
  {
      cout &lt;&lt; *i &lt;&lt; ' ';
  }
  }
  </code></pre>
  
  <p>Gives me the same set of errors as his supplied methods. I'm really perplexed at the moment, and really have no idea what's causing the issue. I'd appreciate some insight, thanks!</p>