Sort bases on the Compare method which returns:
-1: if the "other" object is larger (however you define largeron this object type)
0: if both object are assumed to be the same (this will also be used for remove so don't return 0 if they are the same from sorting view. In this case use -1 or 1. it won't destroy the ordering between objects that are assumed to be smaller or larger to each other). My compare method only returns 0 if the references are pointing to the same object.
1: if the other object is smaller
(or vise versa with 1 / -1)
-1: if the "other" object is larger (however you define largeron this object type)
0: if both object are assumed to be the same (this will also be used for remove so don't return 0 if they are the same from sorting view. In this case use -1 or 1. it won't destroy the ordering between objects that are assumed to be smaller or larger to each other). My compare method only returns 0 if the references are pointing to the same object.
1: if the other object is smaller
(or vise versa with 1 / -1)