当用STL的<algorithm>里的sort,或者nth_element时,在自己写的结构体里面重载大于号或小于号的函数后没有写上const,则会出现这个错误,正确的做法是:
bool operator < (const Node& other) const{
return ...;
}
//如果写成了以下形式就会出现错误
bool operator < (const Node& other){
return ...;
}