title: MSVC++ compiler error C2143
body: <p>The following code excerpt is responsible for a cryptic MSVC++ compiler error:</p>
  
  <pre><code>template&lt;class T&gt; class Vec : public vector&lt;T&gt;{
    public:
      Vec() : vector&lt;T&gt;(){}
      Vec(int s) : vector&lt;T&gt;(s){}
  
      T&amp; operator[](int i){return at(i);  }
      const T&amp; operator[](int i)const{ return at(i);}
  };
  
  ...
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>test.cpp(5) : error C2143: syntax error : missing ',' before '&lt;'
    test.cpp(12) : see reference to class template instantiation 'Vec&lt;T&gt;' being compiled
  </code></pre>
  
  <p>How do I fix this?</p>
  
  <p>---Edit---</p>
  
  <p>Some context:</p>
  
  <p>I am trying to compile code essentially copy and pasted from <em>The C++ Programming Language</em>. I don't yet even understand this code completely. The purpose, however, is to implement a vector type that will throw an exception when some code attempts to access an item out of the vector's range instead of just returning incorrect values.</p>