Link to home
Start Free TrialLog in
Avatar of nexguy
nexguy

asked on

STL sorting

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?  
            Thank you
            Chris Blue
ASKER CERTIFIED SOLUTION
Avatar of yonat
yonat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial