title: erase-remove_if idiom - was anything removed?
body: <p>I'm creating an API which users will call to remove items from an internal vector.  They will pass in criteria to search the vector for elements to remove.  I'd like my API to return a boolean for if any elements were found and removed.</p>
  
  <p>I'm planning on using the <a href="https://en.wikipedia.org/wiki/Erase%E2%80%93remove_idiom" rel="nofollow noreferrer">erase-remove idiom</a> to keep things simple and efficient.  I don't see an obvious way right off to detect that items were actually removed?  Is storing the number of elements in the vector before removing, and comparing the value, my best bet?</p>
  
  <p>Here is some (untested) sample code on this idiom:</p>
  
  <pre><code>std::vector&lt;int&gt; v = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  
  boolean removeMultiples(int multiple) {
      v.erase( std::remove_if(v.begin(), v.end(), [multiple](int i){return i%multiple == 0;}), v.end() );
      // return true if anything was removed
  }
  </code></pre>