title: Negate predicate in remove_if
body: <p>I try to remove objects from a vector using vector::erase and std::remove_if. I have an external namespace which does the selection ala:</p>
  
  <pre><code>template&lt;unsigned int value, someType collection&gt;
  bool Namespace::isValid(const Foo* object){
  
     do something
  }
  </code></pre>
  
  <p>Now I have a vector which contains some element which I want to filter if the are valid. In order to do so I do:</p>
  
  <pre><code> std::vector&lt;foo*&gt; myVector;
   //fill it
   myVector.erase( std::remove_if(myVector.begin(), myVector.end(), Namespace::isValid&lt;myValue, myCollectionType&gt;), myVector.end());
  </code></pre>
  
  <p>Now this works fine and removes all valid candidates, but actually I want to keep and remove all other. Hence, I need to negate the predicate. Is there any way to do so? Unfortunately, C++11 is not currently supported in this context.</p>
  
  <p>Thanks</p>