title: Type and Dependent Name
body: <p>Manually I can create a <code>std::vector&lt;int&gt;::iterator</code> object like:</p>
  
  <pre><code>std::vector&lt;int&gt;::iterator i;
  </code></pre>
  
  <p>So here <code>std::vector&lt;int&gt;::iterator</code> is a type. But when I write a function :</p>
  
  <pre><code>template &lt;class T&gt;
  std::vector&lt;T&gt;::iterator foo(std::vector&lt;int&gt;::iterator i)
  {
      return i;
  }
  </code></pre>
  
  <p>The compiler shows a warning : </p>
  
  <pre><code>std::vector&lt;T&gt;::iterator' : is a dependent name  not a type
  </code></pre>
  
  <p>and the code does not compiles. But if in main I call the function like this:</p>
  
  <pre><code>int main()
  {
      vector&lt;int&gt; v;
      foo(v.begin());
  }
  </code></pre>
  
  <p>The parameter <code>T</code> should be resolved. Then why compiler is showing error?</p>