if (__comp(__a, __b))
this is the error referred to the file above.
basically, it's just about this question :
5-6. Rewrite the extract_fails function from §5.1.1/77 so that instead of erasing each failing student from the input vector v, it copies the records for the passing students to the beginning of v, and then uses the resize function to remove the extra elements from the end of v. How does the performance of this version compare with the one in §5.1.1/77?
So, for "remove the extra elements from the end of v. I need to sort the container again for filtering the failed students
sort(students.begin(), students.end(), indexings);
students.resize(size_count);
"indexings" is a predicate with this functions.
bool indexings(Student_info& A, Student_info& B)
{
A.totals = grade(A.midterm, A.final, A.homework);
B.totals = grade(B.midterm, B.final, B.homework);
return A.totals < B.totals;
}
this is the structure that I used.
struct Student_info
{
std::string name;
double midterm, final, totals;
std::vector<double> homework;
};
I don't know either the problems depend upon wrong using of member, parameter, functions (or anything)!
please help. thank you.