title: What is wrong with my usage of C++ standard library's find?
body: <p>I'm trying to use the C++ standard library's <code>find</code> algorithm like this:</p>
  
  <pre><code>  template&lt;class T&gt;
    const unsigned int AdjacencyList&lt;T&gt;::_index_for_node(
        const std::vector&lt;T&gt;&amp; list, const T&amp; node
    ) throw(NoSuchNodeException)
    {
      std::vector&lt;T&gt;::iterator iter = std::find(list.begin(), list.end(), node);
    }
  </code></pre>
  
  <p>When I try to compile, I get these errors:</p>
  
  <pre><code>In file included from ../AdjacencyList.cpp:8:
  ../AdjacencyList.h: In member function ‘const unsigned int Graph::AdjacencyList&lt;T&gt;::_index_for_node(const std::vector&lt;T, std::allocator&lt;_Tp1&gt; &gt;&amp;, const T&amp;)’:
  ../AdjacencyList.h:99: error: expected ‘;’ before ‘iter’
  ../AdjacencyList.h:100: error: ‘iter’ was not declared in this scope
  In file included from ../AdjacencyListTest.cpp:9:
  ../AdjacencyList.h: In member function ‘const unsigned int Graph::AdjacencyList&lt;T&gt;::_index_for_node(const std::vector&lt;T, std::allocator&lt;_Tp1&gt; &gt;&amp;, const T&amp;)’:
  ../AdjacencyList.h:99: error: expected ‘;’ before ‘iter’
  ../AdjacencyList.h:100: error: ‘iter’ was not declared in this scope
  ../AdjacencyList.h: In member function ‘const unsigned int Graph::AdjacencyList&lt;T&gt;::_index_for_node(const std::vector&lt;T, std::allocator&lt;_Tp1&gt; &gt;&amp;, const T&amp;) [with T = int]’:
  ../AdjacencyList.h:91:   instantiated from ‘const std::vector&lt;T, std::allocator&lt;_Tp1&gt; &gt; Graph::AdjacencyList&lt;T&gt;::neighbours(const T&amp;) [with T = int]’
  ../AdjacencyListTest.cpp:18:   instantiated from here
  ../AdjacencyList.h:99: error: dependent-name ‘std::vector::iterator’ is parsed as a non-type, but instantiation yields a type
  ../AdjacencyList.h:99: note: say ‘typename std::vector::iterator’ if a type is meant
  </code></pre>
  
  <p>I feel like the "dependent-name ‘std::vector::iterator’ is parsed as a non-type, but instantiation yields a type" bit holds the key to understanding what I'm doing wrong, but my pea-brain cannot extract the meaning.</p>
  
  <p><strong>Update:</strong> I needed to add a <code>typename</code>, as per the accepted answer, and also use a <code>const_iterator</code>, so the problematic line of code became:</p>
  
  <pre><code>    typename std::vector&lt;T&gt;::const_iterator iter = std::find(list.begin(), list.end(), node);
  </code></pre>