title: Am I using the copy_if wrong?
body: <p>I am using visual studio 2010 and I am trying to use std::copy_if,
  I want to copy all values that are satisfying a predicate. For example:</p>
  
  <pre><code>struct comp
  {
      bool operator()(const int i) { return i == 5 || i == 7; }
  };
  
  int main()
  {
      array&lt;int, 10&gt; arr =  { 3, 2, 5, 7, 3, 5, 6, 7 };
      vector&lt;int&gt; res;
      copy_if(arr.begin(), arr.end(), res.begin(), comp());
  
      for(int i = 0; i &lt; res.size(); i++)
      {
          cout &lt;&lt; res[i] &lt;&lt; endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>But when I run this code I get: vector iterator not incrementable.</p>