Quote Originally Posted by sarmadys View Post
That code would work if it was not in a class and the predicate was not a member function. However, now I receive long error messages which I guess refer to incompatibility of remove_if template with the predicate parameter (one error includes : error C2064: term does not evaluate to a function taking 1 arguments).
That's because member functions have an implicit first argument, which is the this pointer. So, to call a member function, you need an instance of the class to call it on.

Given that your function does not use any class members you can also make the function a static member, or use a global function (possibly in an anonymous namespace), or use locally defined function object - see below -, or use a lambda function if your compiler supports it.

Code:
void classname::function1()
{
    vector<MoorePoint> neighbors;
    //....
    struct {
        bool operator ()(const MoorePoint& mp) const {
            return !mp.inGridNotOccupied;
        }
    } cannotMoveIn;
    neighbors.erase(std::remove_if(neighbors.begin(), neighbors.end(), cannotMoveIn), neighbors.end()); 
}