Consider you have a Person class: You want to store several instances of this class in a vector: If you want to sort this vector by the person ID, you could implement a PersonComparator and use the STL sort algorithm: In C++03 you need to create a separate class (or alternatively a function) to use […]
