title: function template with stl container as an input
body: <p>I am getting compilation error is following code. I thought this should have worked in c++
  Can anybody help me to understand what is wrong here.</p>
  
  <pre><code>template &lt; typename elem_type&gt;
  elem_type *find2( std::vector&lt;elem_type&gt;&amp; vec, elem_type value) {
      for ( int i = 0; i &lt; vec.size(); ++i) {
          if ( vec[i] == value ) {
              return &amp;vec[i];
          }
      }
      return 0;
  }
  int main( int argc, char **argv) {
      int arr[10] = {1,2,3,4,5,6,7,8,9,10};
      std::vector&lt;int&gt; vec( arr, arr+10);     
      int value = 9;
      int *ptr1 = find2(vec,value);
  }
  </code></pre>
  
  <p>following is the compilation error</p>
  
  <pre><code>1&gt;          d:\personal\work\find\find\find.cpp(25) : see reference to function template instantiation 'elem_type *find2&lt;int&gt;(std::vector&lt;_Ty&gt; &amp;,elem_type &amp;)' being compiled
  1&gt;          with
  1&gt;          [
  1&gt;              elem_type=int,
  1&gt;              _Ty=int
  1&gt;          ]
  </code></pre>
  
  <p>compiler is <code>Visual Studio 11</code></p>