Help with stl remove_if

I'm trying to use remove_if to remove an object from a vector if the curHP value is equal to or less than 0. This is how I have it set up:

1
2
3
4
5
6
7
8
9
bool kill(vector<Character*> chVec){

	chVec.erase(remove_if(chVec.begin(), chVec.end(), killCheck), chVec.end());
	return true;
}

bool killCheck(Character * ch){
	return (ch->getCurHP() <= 0);
}


And this is the error message I receive:

 
1>error C3867: 'killCheck': function call missing argument list; use '&killCheck' to create a pointer to member


The reference on this website for remove_if says that the third parameter for remove should either be a function pointer or an object that overloads operator(). I'm only familiar in passing with both of those concepts, and I'm not sure how to implement either in this situation.
Last edited on
Well do as the compiler says that is use &killCheck inside the algorithm call.
I suppose I should have added, trying that leads to

error C2276: '&' : illegal operation on bound member function expression
Topic archived. No new replies allowed.