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函数
最新推荐文章于 2024-06-17 11:15:10 发布