how exactly will the structure elements get compared. And what role does tie() play in it?

前端 未结 0 512
执念已碎
执念已碎 2021-01-05 02:51
struct man {
  int h, w, id;
};

bool operator<(const man &a, const man &b) {
  return tie(a.h, a.w, a.id) < tie(b.h, b.w, b.id);
}

ho

相关标签:
回答
  • 消灭零回复
提交回复
热议问题