如果你想用重载运算符的方式来对结构体排序,函数头务必写成
bool operator<(const T& b)const{//成员函数
或者
bool operator<(const T& a,const T& b){//非成员函数
尤其是成员函数版本,花括号前面的 const 不是必要的,而是极其必要的,否则会 CE。
const
CE