struct Type{
int a;
double b;
//升序需要的操作符函数
bool operator < (const Type& right) const
{
return a < right.a;
}//asscend
//降序需要的操作符函数
bool operator > (const Type& right) const
{
return a > right.a;
}//desscend
};
自定义类型struct的排序-sort函数
最新推荐文章于 2023-07-21 18:01:20 发布