How to declare an iterator for a vector of a generic type?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords">Where and why do I have to put the &ldquo;template&rdquo; and &ldquo;typename&rdquo; keywords?</a>  </p>
</blockquote>



<p>I have problems declaring an iterator for a vector that is of a generic type.
Code as follows:</p>

<pre><code>    template &lt;class T&gt; void print(const vector&lt;T&gt;&amp; V )
    {
      vector&lt;T&gt;::const_iterator i;
    }
</code></pre>

<p>The following returns an error expected ; before 'i'.
There will be no error if I specifically stated <code>vector&lt;int&gt;::const_iterator i;</code></p>

<p>Is there a way to solve the problem?</p>
