Posted on 1998-02-08
I am using the Standard Template Library in a program that involves sorting linked lists. I have an object defined that contains two variables, int ID and char TYPE. I also have defined the operator< and operator == which involves the ID variable. So an STL sort would sort the dequeue by the ID number. I also want to sort by the TYPE. For example, If I am sorting by ID number, and two identical number come up, I want to be able to break the tie by choosing the object with the highest TYPE priority. I would also like to be able to sort by TYPE. Is there any way to use the STL to sort a dequeue of object by more than one object variable?