I have several pointers to objects in a vector to be sorted. I think I can use sort(myVector.begin(),myVector.end()) but this method sort by pointer memory directions.
I have an object called Vehicle with an int price. So I'd like to sort the vehicles by price.
Is there any method to use sort and tell it to sort by the objects instead of sorting by the pointers of the vectors ?