Usage of predicate function in std::remove_if
<p>I have a vector of objects. My data structure is the following:</p>

<pre><code> class my_class{
       float a; int b;
 };
 my_class obj;
 vector&lt;my_class&gt; vec;
</code></pre>

<p>The vector vec contains data of the form:</p>

<pre><code> vec
 ((10.0,2),(100,3),(19.0,3)...)
</code></pre>

<p>Now from vector vec I intend to delete the elements which are less than or equal to the last element of vec...For this I am using erase and remove_if functions:</p>

<pre><code>vec.erase(std::remove_if(vec.begin(), vec.end(), predicate_function(vec, (vec.end()-1).a, (vec.end()-1).b)), vec.end());
</code></pre>

<p>The predicate_function which I have does an iteration over "vec". However, this defeats the purpose of using std::remove_if. Can someone please help as to what the predicate_function should look like in order for remove_if to work. I dont want to use lambda_function. Also my compiler is GCC</p>
