title: Template function with iterators
body: <p>I've been trying to do Ex. 10-02 in Accelerated C++, and it was giving me errors and I eventually kept "simplifying" my program until I got to this point, and even still it wouldn't compile (via g++) giving me the error:</p>
  
  <pre><code>test.cpp: In function ‘int main()’:
  test.cpp:22: error: no matching function for call to ‘dumb(__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;)’
  </code></pre>
  
  <p>Here's my program:</p>
  
  <pre><code>#include &lt;algorithm&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using std::cout;    using std::endl;
  using std::vector;
  
  template &lt;class Ran, class T&gt; T dumb(Ran begin, Ran end)
  {
      return *begin;
  }
  
  int main()
  {
      vector&lt;int&gt; myVector;
      for (int i = 1; i &lt;= 9; ++i)
          myVector.push_back(i);
  
      int d = dumb(myVector.begin(), myVector.end());
      cout &lt;&lt; "Value = " &lt;&lt; d &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>What's causing this error?</p>