title: Syntax for constructor in template class
body: <p>I am trying to create a generic circular buffer template but there is some syntax error that I cannot understand.  The error is in my constructor, though it seems I've parameterized the destructor in the same way and that one works. I've followed the example in Stroustrup C++, and he uses a parameter before the scope resolution operator and also in the function name, just as I have.  I'm also certain there are no circular dependencies because I'm only compiling one file.  Also the implementation and declarations are in the same file (CircBuf.h) and there is no corresponding .cpp file, so linking should not be an issue either.  I've tried adding the "inline" keyword as per <a href="http://www.parashift.com/c++-faq-lite/templates.html#faq-35.2" rel="noreferrer">this</a> solution and I get the same error.</p>
  
  
  
  <pre class="lang-cpp prettyprint-override"><code>/* CircBuf.h */
  template&lt;typename T&gt; class CircBuf {
    // don't use default ctor                                                                                                                                               
    CircBuf();
  
    int size;
    T *data;
  public:
    CircBuf(int);
    ~CircBuf();
  };
  
  template&lt;typename T&gt; CircBuff&lt;T&gt;::CircBuf&lt;T&gt;(int i) {
    data = new T[i];
  }
  template&lt;typename T&gt; CircBuf&lt;T&gt;::~CircBuf&lt;T&gt;() {
    delete data;
  }
  </code></pre>
  
  <p>makefile</p>
  
  <pre class="lang-cpp prettyprint-override"><code>all:
          g++ -g -pedantic CircBuf.h -o prog
  </code></pre>
  
  <p>compiler-error</p>
  
  <pre class="lang-cpp prettyprint-override"><code>CircBuf.h:13:22: error: ‘CircBuff’ does not name a type
  </code></pre>