title: no matching function for call to ‘find'
body: <p>I have the following code:</p>
  
  <pre><code>#include &lt;algorithm&gt;
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main()
  {   
      typedef vector&lt;int&gt; IntContainer;
      typedef IntContainer::iterator IntIterator;
  
      IntContainer vw;
  
      IntIterator i = find(vw.begin(), vw.end(), 5);
  
      if (i != vw.end()) 
          {
          printf("Find 5 in vector\n");   // found it
        }
          else 
          {
              printf("Couldn't find 5 in vector\n");  // couldn't found it
          }
  
      return 0;
  }
  </code></pre>
  
  <p>I try to compile it on Ubuntu with gcc 4.7.1 and get the following error:</p>
  
  <pre><code>vec_test.cpp: In function ‘int main()’:
  vec_test.cpp:27:46: error: no matching function for call to ‘find(std::vector&lt;int&gt;::iterator, std::vector&lt;int&gt;::iterator, int)’
  vec_test.cpp:27:46: note: candidate is:
  In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/locale_facets.h:50:0,
                   from /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/basic_ios.h:39,
                   from /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ios:45,
                   from /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ostream:40,
                   from /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/iostream:40,
                   from vec_test.cpp:3:
  /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/streambuf_iterator.h:371:5: note: template&lt;class _CharT2&gt; typename __gnu_cxx::__enable_if&lt;std::__is_char&lt;_CharT2&gt;::__value, std::istreambuf_iterator&lt;_CharT2, std::char_traits&lt;_CharT&gt; &gt; &gt;::__type std::find(std::istreambuf_iterator&lt;_CharT2, std::char_traits&lt;_CharT&gt; &gt;, std::istreambuf_iterator&lt;_CharT2, std::char_traits&lt;_CharT&gt; &gt;, const _CharT2&amp;)
  /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.1/../../../../include/c++/4.7.1/bits/streambuf_iterator.h:371:5: note:   template argument deduction/substitution failed:
  vec_test.cpp:27:46: note:   ‘__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;’ is not derived from ‘std::istreambuf_iterator&lt;_CharT2, std::char_traits&lt;_CharT&gt; &gt;’
  </code></pre>
  
  <p>This code doesn't do anything since the vector is not initialized with any content but it should compile.</p>
  
  <p>I suspect this is a gcc problem but after lots of digging I'm quit desperate.
  Please let me know if anyone encountered this problem and knows how to solve it.</p>