#include <vector>
using std::vector;
     
#include <algorithm>
using std::sort;
     
#include <iostream>
using std::cout;
     
class CartesianPoint
{
   private:
      int x;
      int y;
    
   public:
      int getX() const { return x; }
      int getY() const { return y; }
      CartesianPoint(int x, int y) : x(x), y(y) { }
      bool operator< (const CartesianPoint& that) const { return x < that.x; }

};
     
int main() 
{
   vector<CartesianPoint> myvector { {10, 13}, {32, 1}, {5, 29}, {12, 6}, {21, 100} };

   auto cmpFunc = [](const auto& p1, const auto& p2) { return p1 < p2; };
   sort(myvector.begin(), myvector.end(), cmpFunc); 
     
   cout << "myvector contains:";
     
   for (const auto& point : myvector)
       cout << ' ' << '(' << point.getX() << ',' << point.getY() << ')';
     
   cout << '\n';
}
     