(構造体の中で関数) & (タプルを使って比較演算定義)

struct S{
  int w,h,l;

  S(int w, int h):w(w), h(h){
    l = w*w + h*h;
  }
};

bool operator<(const S& a, const S& b)
{
  // l、hの順番で優先順位を付けて比較
  return tie(a.l, a.h) < tie(b.l, b.h);
}

関数の定義の書き方がいまいちよくわからない。こういう関数の名前はなんというのだろう。