My delete is not working. Why?
Code:
struct MatchName
{
MatchName(string& searchName) : s_(searchName) {}
bool operator()(const clsStudent* student) const
{
return student->getName() == s_;
}
private:
string s_;
};
void deleteStudent(vector <clsStudent*>& student)
{
string nameToDelete;
if (!(student.empty()))
{
cout << "\nEnter name of student to delete: " << endl;
cin >> nameToDelete;
remove_if(student.begin(), student.end(), MatchName(nameToDelete));
cout << "Student " << nameToDelete << " deleted.";
}
else{
cout << "\nUnable to perform selected action.";
cout << "\nThere is " << student.size() << " of students to delete\n" ;
}
}