Template question

Hi at all . I have a question about template and STL (sort,remove_if ..)
I have a template class with some member. In one of this i have a struct like this

1
2
3
4
5
6
7

struct predication : std::unary_function<my_type, bool> {
      T diff;
      bool operator()(my_type& e) { return e.field >= *field; } 
      predication (T& field) : diff(field) { }
    } a_predication(esternal_params);
    auto nend = std::remove_if(begin_iterator(),end_iterator(),a_predication);


But when i compile i recive a no matching error with std::remove_if . Why ?
The same if try sort in another parte of code with a std::unary_function predicate


Try to inherit fron std::unary_function<bool, my_type> instead. Also, it would be great if you posted the whole code.
Last edited on
Topic archived. No new replies allowed.