Kinniken
Registered
Hi, I have a vector of objects "students" with an overload < operator which allows me to sort it with the following command:
sort(students_list->begin(), students_list->end());
This works fine. However, I need to do the same with a vector of pointers to students. Is there a way I can use the sort() method on it, since the "<" operator is now applied to the pointers and not the student objects? Or will I have to code my own sorting algorithm?
Any help would be much appreciated!
sort(students_list->begin(), students_list->end());
This works fine. However, I need to do the same with a vector of pointers to students. Is there a way I can use the sort() method on it, since the "<" operator is now applied to the pointers and not the student objects? Or will I have to code my own sorting algorithm?
Any help would be much appreciated!