I have a object container, list; and class Foo have a member function id() return an integer identifier. Now I want to use stl algorithm remove_if to remove some objects whose id is less than a value. I don't want to provide a function for id compare, If it is possible for me to write one line code with STL but boost to implement it.
class Foo{
public:
unsigned id() const {return id_;}
...
private:
unsigned id_
...
};
list<Foo> foo_list;
std::remove_if(foo_list.begin(), foo_list.end(), ???);
If STL can do this with only std::bind2nd, stl::less(), std::mem_fun_ref() or other stl functions.