How does one go about sorting a vector containing custom (i.e. user defined) objects. Probably, standard STL algorithm sort along with a predicate (a fu
You can use user defined comparator class.
class comparator { int x; bool operator()( const comparator &m, const comparator &n ) { return m.x<n.x; } }