Sorting <vector> of objects

closed account (10oTURfi)
I am looking for a simple way to sort <vector> of custom objects by value stored in member var of those objects. Is it possible to bubble sort it with swap?
Hopefully that made sense :)
Last edited on
See http://cplusplus.com/reference/algorithm/sort/
Note that you'll have to write a function to compare two elements.
Of course, you could write the same yourself..
Last edited on
Topic archived. No new replies allowed.