title: Sorting a vector that contains pair<x,y>
body: <p>I have seen a code somewhere in which a guy did something like this</p>
  
  <pre><code>#define pp pair&lt;int,int&gt;
  int main()
  {
    int n,i;
    scanf("%d",&amp;n);
    vector&lt;pp&gt; G;
    for(i=0;i&lt;n;i++)
    {
       int x,y;
       scanf("%d%d",&amp;x,&amp;y);
       G.push_back(pp(x+y,x-y));
    }
    sort(G.begin(),G.end());
  </code></pre>
  
  <p>I want to know how sorting is done here. I mean to say <strong>on what parameter sorting is performed in a vector that contains pairs in it</strong>.</p>