title: std::remove_if not working properly
body: <p>Here my code. I want remove from vector all elements with successfully called method 'release'.</p>
  
  <pre><code>bool foo::release()
  {
      return true;
  }
  
  // ...
  vector&lt;foo&gt; vec;
  // ...
  remove_if(vec.begin(), vec.end(), [](foo &amp; f) { return f.release() == true; });
  // ...
  </code></pre>
  
  <p>But <code>remove_if</code> not deleting all elements from <code>vector vec</code>. How <code>remove_if</code> works?</p>