https://blog.csdn.net/sunny1996/article/details/51242184
结构体内重载操作符时注意 函数的参数,通常为结构体内定义的变量-1个
法2
结构体内部 定义 cmp 比较函数
bool compare(const PAIR &x, const PAIR &y)
{
return x.point_value > y.point_value;
}
结构体内部的构造函数的写法
struct qnode{
int u;
int w;
qnode(int u=0,int w=0):u(u),w(w){}//构造函数
bool operator < (const qnode& a) const{//结构体 重载 <
return w>a.w;
}
};