Don't talk about the code
Using namespace STD; </P> <p> template <class T> <br/> Class A: Public unary_function <t, bool> <br/>{< br/> Public: <br/> A (t m): X (m) {}< br/> bool operator () (T m) const <br/>{< br/> return M = x; <br/>}< br/> PRIVATE: <br/> t x; <br/>}; </P> <p> template <class T> <br/> Class B: Public binary_function <t, t, bool> <br/>{< br/> Public: <br/> // B (): x (0) {}< br/> bool operator () (const T & T1, const T & T2) const // here const is indispensable <br/>{< br/> return t1 <t2; <br/>}< br/> PRIVATE: <br/> // t x; <br/>}; <br/> int main () <br/>{< br/> vector <int> Col; <br/> insert (COL, 1, 9 ); // self-defined function <br/> // remove_if the third parameter requires a unary predicate <br/> remove_if (Col. begin (), Col. end (), a <int> (5); // use The unary predicate to remove the first remove_if (Col. begin (), Col. end (), bind2nd (B <int> (), 5); // use binary predicates to remove print (COL) with more than 5 elements ); </P> <p> return 0; <br/>}