title: vector<T>::iterator - invalid?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1301380/g-is-not-a-type-error">g++ &ldquo;is not a type&rdquo; error </a>  </p>
  </blockquote>
  
  
  
  <p>The following does not compile:</p>
  
  <pre><code>1    template&lt;typename T&gt;
  2    void foo(std::vector&lt;T&gt;::iterator &amp; i)
  3    {  
  4    }
  </code></pre>
  
  <p>On Visual Studio, I get the following errors:</p>
  
  <pre><code>&gt;(2) error C2065: 'i' : undeclared identifier
  &gt;(4) warning C4346: 'std::vector&lt;_Tp&gt;::iterator' : dependent name is not a type
       prefix with 'typename' to indicate a type
  &gt;(4) error C2182: 'foo' : illegal use of type 'void'
  &gt;(4) error C2998: 'int foo' : cannot be a template definition
  </code></pre>