I've been re-reading Scott Meyer's chapter about STL sorting algorithms, and I was wondering when someone would want to use stable_sort() instead of just sort()?
If two objects are equivalent, what difference does it make which one precedes the other? They are equivalent after all...
So far, the only case I could think of for using stable_sort() is if you need to sort a container twice -- once for one criteria, then again for another criteria and you don't want to lose the sorting done in the first sort.
Can anyone tell me what other situations you would use a stable_sort() for and how often people actually use it in their code when they need to sort something?