I don't understand why this code doesn't work.
Note that i have written the bool function in .h StudentBook class, order function in .cpp StudentBook class, i have included Exam class in StudentBook class,grade() is a function of Exam class and _v is a vector of Exam object.
good, but just so you know your cmd() function was also fine. you just had to supply it as the predicate argument to std::sort() without the StudentBook:: scope