STL对结构中的排序规则一般写在结构体中
如
struct fl{ int w,c; bool operator <(const fl &s) const { return c<s.c; } }; set<fl> a; }
那能不能写一个cmp函数进行排序
例
struct fl{ int w,c; }; bool cmp(fl a,fl b){ return a.w<b.w; }
如何将这个cmp函数应用在STL中?